Title: [96590] trunk/Source/WebKit/chromium
Revision
96590
Author
[email protected]
Date
2011-10-04 07:12:19 -0700 (Tue, 04 Oct 2011)

Log Message

[Chromium] Web Inspector: save inspector state into single string instead of string map
https://bugs.webkit.org/show_bug.cgi?id=69335

Added explicit methods for saving and restoring agent runtime state.

Reviewed by Pavel Feldman.

* public/WebDevToolsAgent.h:
* public/WebDevToolsAgentClient.h:
(WebKit::WebDevToolsAgentClient::saveAgentRuntimeState):
* src/WebDevToolsAgentImpl.cpp:
(WebKit::WebDevToolsAgentImpl::reattach):
(WebKit::WebDevToolsAgentImpl::updateInspectorStateCookie):
* src/WebDevToolsAgentImpl.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (96589 => 96590)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-10-04 14:09:06 UTC (rev 96589)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-10-04 14:12:19 UTC (rev 96590)
@@ -1,3 +1,20 @@
+2011-10-04  Yury Semikhatsky  <[email protected]>
+
+        [Chromium] Web Inspector: save inspector state into single string instead of string map
+        https://bugs.webkit.org/show_bug.cgi?id=69335
+
+        Added explicit methods for saving and restoring agent runtime state.
+
+        Reviewed by Pavel Feldman.
+
+        * public/WebDevToolsAgent.h:
+        * public/WebDevToolsAgentClient.h:
+        (WebKit::WebDevToolsAgentClient::saveAgentRuntimeState):
+        * src/WebDevToolsAgentImpl.cpp:
+        (WebKit::WebDevToolsAgentImpl::reattach):
+        (WebKit::WebDevToolsAgentImpl::updateInspectorStateCookie):
+        * src/WebDevToolsAgentImpl.h:
+
 2011-10-03  James Robinson  <[email protected]>
 
         [chromium] Tweak WebCompositor API for input event handling to express three possible states

Modified: trunk/Source/WebKit/chromium/public/WebDevToolsAgent.h (96589 => 96590)


--- trunk/Source/WebKit/chromium/public/WebDevToolsAgent.h	2011-10-04 14:09:06 UTC (rev 96589)
+++ trunk/Source/WebKit/chromium/public/WebDevToolsAgent.h	2011-10-04 14:12:19 UTC (rev 96590)
@@ -56,6 +56,7 @@
     WEBKIT_EXPORT static bool supportsInspectorProtocolVersion(const WebString& version);
 
     virtual void attach() = 0;
+    virtual void reattach(const WebString& savedState) = 0;
     virtual void detach() = 0;
     virtual void frontendLoaded() = 0;
 
@@ -64,6 +65,7 @@
     virtual void dispatchOnInspectorBackend(const WebString& message) = 0;
 
     virtual void inspectElementAt(const WebPoint&) = 0;
+    // Deprecated. Will be removed shortly.
     virtual void setRuntimeProperty(const WebString& name, const WebString& value) = 0;
     virtual void setProcessId(long) = 0;
 

Modified: trunk/Source/WebKit/chromium/public/WebDevToolsAgentClient.h (96589 => 96590)


--- trunk/Source/WebKit/chromium/public/WebDevToolsAgentClient.h	2011-10-04 14:09:06 UTC (rev 96589)
+++ trunk/Source/WebKit/chromium/public/WebDevToolsAgentClient.h	2011-10-04 14:12:19 UTC (rev 96590)
@@ -48,6 +48,9 @@
 
     // Notifies host upon runtime feature being enabled/disabled.
     virtual void runtimePropertyChanged(const WebString& name, const WebString& value) { }
+    // Save the agent state in order to pass it later into WebDevToolsAgent::reattach
+    // if the same client is reattached to another agent.
+    virtual void saveAgentRuntimeState(const WebString&) { }
 
     class WebKitClientMessageLoop {
     public:

Modified: trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp (96589 => 96590)


--- trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp	2011-10-04 14:09:06 UTC (rev 96589)
+++ trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp	2011-10-04 14:12:19 UTC (rev 96590)
@@ -207,6 +207,12 @@
     m_attached = true;
 }
 
+void WebDevToolsAgentImpl::reattach(const WebString& savedState)
+{
+    attach();
+    inspectorController()->restoreInspectorStateFromCookie(savedState);
+}
+
 void WebDevToolsAgentImpl::detach()
 {
     // Prevent controller from sending messages to the frontend.
@@ -306,6 +312,7 @@
 void WebDevToolsAgentImpl::updateInspectorStateCookie(const String& state)
 {
     m_client->runtimePropertyChanged(kInspectorStateFeatureName, state);
+    m_client->saveAgentRuntimeState(state);
 }
 
 void WebDevToolsAgentImpl::clearBrowserCache()

Modified: trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h (96589 => 96590)


--- trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h	2011-10-04 14:09:06 UTC (rev 96589)
+++ trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h	2011-10-04 14:12:19 UTC (rev 96590)
@@ -73,6 +73,7 @@
 
     // WebDevToolsAgent implementation.
     virtual void attach();
+    virtual void reattach(const WebString& savedState);
     virtual void detach();
     virtual void frontendLoaded();
     virtual void didNavigate();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to