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.
Created attachment 86160 [details] Patch.
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.
Created attachment 86163 [details] Patch.
(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 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
Committed r81470: <http://trac.webkit.org/changeset/81470>