Bug 56643 - Web Inspector: implement inspector session storage.
Summary: Web Inspector: implement inspector session storage.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Podivilov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-18 06:28 PDT by Pavel Podivilov
Modified: 2011-03-18 08:43 PDT (History)
10 users (show)

See Also:


Attachments
Patch. (11.32 KB, patch)
2011-03-18 06:29 PDT, Pavel Podivilov
yurys: review-
Details | Formatted Diff | Diff
Patch. (12.45 KB, patch)
2011-03-18 07:41 PDT, Pavel Podivilov
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Podivilov 2011-03-18 06:28:54 PDT
Web Inspector: implement inspector session storage.

We would like to enable debugger/profiler from frontend side only. However, when user clicks "Start Debugging JavaScript" in Safari, we need to enable debugger when frontend is opened or re-opened for the same page.
The idea is to store debugger-enabled setting in session storage and check it on frontend load.
Comment 1 Pavel Podivilov 2011-03-18 06:29:49 PDT
Created attachment 86160 [details]
Patch.
Comment 2 Yury Semikhatsky 2011-03-18 06:59:29 PDT
Comment on attachment 86160 [details]
Patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=86160&action=review

> Source/WebCore/WebCore.exp.in:1283
> +__ZN7WebCore15InspectorClient18loadSessionSettingERKN3WTF6StringEPS2_

Mind alphabetic order. Also most of the inspector symbols are guarded by #if ENABLE(INSPECTOR) (see http://trac.webkit.org/browser/trunk/Source/WebCore/WebCore.exp.in#L1489) , you should move this couple there as well.

> Source/WebCore/inspector/InspectorClient.h:59
> +    void saveSessionSetting(const String& key, const String& value);

InspectorClient API has nothing to do with these storage. The fact that the session storage is implemented on the inspector client is platform-specific and should be implemented in the WebKit layer.

> Source/WebCore/inspector/InspectorFrontendHost.cpp:225
> +    m_client->saveSessionSetting(key, value);

You should check that the client has not been disconnected yet as in the other methods.

> Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm:207
> +    InspectorClient* client = [m_windowController.get() inspectorClient];

You should use platform-specific storage here, generic interface shouldn't contain session storage methods.
Comment 3 Pavel Podivilov 2011-03-18 07:41:10 PDT
Created attachment 86163 [details]
Patch.
Comment 4 Pavel Podivilov 2011-03-18 07:41:18 PDT
(In reply to comment #2)
> (From update of attachment 86160 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=86160&action=review
> 
> > Source/WebCore/WebCore.exp.in:1283
> > +__ZN7WebCore15InspectorClient18loadSessionSettingERKN3WTF6StringEPS2_
> 
> Mind alphabetic order. Also most of the inspector symbols are guarded by #if ENABLE(INSPECTOR) (see http://trac.webkit.org/browser/trunk/Source/WebCore/WebCore.exp.in#L1489) , you should move this couple there as well.
> 
> > Source/WebCore/inspector/InspectorClient.h:59
> > +    void saveSessionSetting(const String& key, const String& value);
> 
> InspectorClient API has nothing to do with these storage. The fact that the session storage is implemented on the inspector client is platform-specific and should be implemented in the WebKit layer.
> 
> > Source/WebCore/inspector/InspectorFrontendHost.cpp:225
> > +    m_client->saveSessionSetting(key, value);
> 
> You should check that the client has not been disconnected yet as in the other methods.
> 
> > Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm:207
> > +    InspectorClient* client = [m_windowController.get() inspectorClient];
> 
> You should use platform-specific storage here, generic interface shouldn't contain session storage methods.

Done.
Comment 5 Yury Semikhatsky 2011-03-18 08:04:00 PDT
Comment on attachment 86163 [details]
Patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=86163&action=review

> Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm:122
> +void WebInspectorClient::saveSessionSetting(const String& key, const String& value)

Consider moving these two methods to WebKit/cf
Comment 6 Pavel Podivilov 2011-03-18 08:43:40 PDT
Committed r81470: <http://trac.webkit.org/changeset/81470>