Web Inspector: InspectorState::updateCookie should not do JSON serialization if unsup...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2012 09:14:01 +0000 (09:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2012 09:14:01 +0000 (09:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=89743

Source/WebCore:

Since all InspectorClient's are InspectorStateClient's provide a
virtual accessor that determines whether or not InspectorClient updates
are supported or not.

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2012-06-22
Reviewed by Yury Semikhatsky.

* inspector/InspectorState.cpp:
(WebCore::InspectorState::updateCookie):
Don't serialize and message the client if the client doesn't do anything with it.

* inspector/InspectorStateClient.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::InspectorStateClient::supportsInspectorStateUpdates):
Let the client say whether or not supports updates or not.

Source/WebKit/blackberry:

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2012-06-22
Reviewed by Yury Semikhatsky.

* WebCoreSupport/InspectorClientBlackBerry.cpp:
(WebCore::InspectorClientBlackBerry::updateInspectorStateCookie):

Source/WebKit/chromium:

The Chromium port does want InspectorState updates.

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2012-06-22
Reviewed by Yury Semikhatsky.

* src/InspectorClientImpl.h:
(WebKit::InspectorClientImpl::supportsInspectorStateUpdates):
* src/WebDevToolsAgentImpl.h:
(WebKit::WebDevToolsAgentImpl::supportsInspectorStateUpdates):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@121013 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorState.cpp
Source/WebCore/inspector/InspectorStateClient.h
Source/WebCore/inspector/WorkerInspectorController.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/InspectorClientBlackBerry.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/InspectorClientImpl.h
Source/WebKit/chromium/src/WebDevToolsAgentImpl.h

index 6e93d81..1c3f4c7 100644 (file)
@@ -1,3 +1,23 @@
+2012-06-22  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: InspectorState::updateCookie should not do JSON serialization if unsupported
+        https://bugs.webkit.org/show_bug.cgi?id=89743
+
+        Since all InspectorClient's are InspectorStateClient's provide a
+        virtual accessor that determines whether or not InspectorClient updates
+        are supported or not.
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/InspectorState.cpp:
+        (WebCore::InspectorState::updateCookie):
+        Don't serialize and message the client if the client doesn't do anything with it.
+
+        * inspector/InspectorStateClient.h:
+        * inspector/WorkerInspectorController.cpp:
+        (WebCore::InspectorStateClient::supportsInspectorStateUpdates):
+        Let the client say whether or not supports updates or not.
+
 2012-06-21  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r120982.
index 7e02eb7..70a2439 100644 (file)
@@ -65,7 +65,7 @@ void InspectorState::unmute()
 
 void InspectorState::updateCookie()
 {
-    if (m_client && !m_isOnMute)
+    if (m_client && !m_isOnMute && m_client->supportsInspectorStateUpdates())
         m_client->updateInspectorStateCookie(m_properties->toJSONString());
 }
 
index 214c707..7d6f55c 100644 (file)
@@ -37,6 +37,7 @@ public:
     // Navigation can cause some WebKit implementations to change the view / page / inspector controller instance.
     // However, there are some inspector controller states that should survive navigation (such as tracking resources
     // or recording timeline) and worker restart. Following callbacks allow embedders to track these states.
+    virtual bool supportsInspectorStateUpdates() const { return false; }
     virtual void updateInspectorStateCookie(const String&) { };
 };
 
index 4d16eb6..7d7aa9b 100644 (file)
@@ -77,6 +77,7 @@ public:
     virtual ~WorkerStateClient() { }
 
 private:
+    virtual bool supportsInspectorStateUpdates() const { return true; }
     virtual void updateInspectorStateCookie(const String& cookie)
     {
         m_workerContext->thread()->workerReportingProxy().updateInspectorStateCookie(cookie);
index d9d3e2f..4e4547b 100644 (file)
@@ -1,3 +1,13 @@
+2012-06-22  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: InspectorState::updateCookie should not do JSON serialization if unsupported
+        https://bugs.webkit.org/show_bug.cgi?id=89743
+
+        Reviewed by Yury Semikhatsky.
+
+        * WebCoreSupport/InspectorClientBlackBerry.cpp:
+        (WebCore::InspectorClientBlackBerry::updateInspectorStateCookie):
+
 2012-06-21  Parth Patel  <parpatel@rim.com>
 
         [Blackberry] BlackBerry::Platform::Settings::get() rename to BlackBerry::Platform::Settings::instance() to make it consistent with our other singletons
index dbb5f08..22e2364 100644 (file)
@@ -87,6 +87,7 @@ void InspectorClientBlackBerry::clearBrowserCookies()
 
 void InspectorClientBlackBerry::updateInspectorStateCookie(const String& cookie)
 {
+    // If this is implemented, we should override and return true in InspectorStateClient::supportsInspectorStateUpdates().
     notImplemented();
 };
 
index bdb762e..63bb8ac 100644 (file)
@@ -1,3 +1,17 @@
+2012-06-22  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: InspectorState::updateCookie should not do JSON serialization if unsupported
+        https://bugs.webkit.org/show_bug.cgi?id=89743
+
+        The Chromium port does want InspectorState updates.
+
+        Reviewed by Yury Semikhatsky.
+
+        * src/InspectorClientImpl.h:
+        (WebKit::InspectorClientImpl::supportsInspectorStateUpdates):
+        * src/WebDevToolsAgentImpl.h:
+        (WebKit::WebDevToolsAgentImpl::supportsInspectorStateUpdates):
+
 2012-06-21  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r120982.
index 6cb5c55..5ea6bae 100644 (file)
@@ -59,6 +59,7 @@ public:
 
     virtual bool sendMessageToFrontend(const WTF::String&);
 
+    virtual bool supportsInspectorStateUpdates() const { return true; }
     virtual void updateInspectorStateCookie(const WTF::String&);
 
     virtual bool canClearBrowserCache();
index edbee14..6b52476 100644 (file)
@@ -94,6 +94,7 @@ public:
     virtual void bringFrontendToFront();
     virtual void highlight();
     virtual void hideHighlight();
+    virtual bool supportsInspectorStateUpdates() const { return true; }
     virtual void updateInspectorStateCookie(const WTF::String&);
     virtual bool sendMessageToFrontend(const WTF::String&);