Web Inspector: convert workers inspection into capability
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2013 13:38:33 +0000 (13:38 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2013 13:38:33 +0000 (13:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112251

Reviewed by Vsevolod Vlasov.

Source/WebCore:

It should be up to backend

* inspector/Inspector.json:
* inspector/InspectorFrontendClient.h:
(InspectorFrontendClient):
* inspector/InspectorFrontendClientLocal.h:
* inspector/InspectorFrontendHost.cpp:
* inspector/InspectorFrontendHost.h:
(InspectorFrontendHost):
* inspector/InspectorFrontendHost.idl:
* inspector/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::canInspectWorkers):
(WebCore):
* inspector/InspectorWorkerAgent.h:
(InspectorWorkerAgent):
* inspector/front-end/InspectorFrontendHostStub.js:
* inspector/front-end/Settings.js:
* inspector/front-end/externs.js:
* inspector/front-end/inspector.js:
(WebInspector.doLoadedDone):

Source/WebKit/chromium:

* src/InspectorFrontendClientImpl.cpp:
* src/InspectorFrontendClientImpl.h:
(InspectorFrontendClientImpl):

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

17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/inspector/Inspector.json
Source/WebCore/inspector/InspectorFrontendClient.h
Source/WebCore/inspector/InspectorFrontendClientLocal.h
Source/WebCore/inspector/InspectorFrontendHost.cpp
Source/WebCore/inspector/InspectorFrontendHost.h
Source/WebCore/inspector/InspectorFrontendHost.idl
Source/WebCore/inspector/InspectorWorkerAgent.cpp
Source/WebCore/inspector/InspectorWorkerAgent.h
Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js
Source/WebCore/inspector/front-end/ScriptsPanel.js
Source/WebCore/inspector/front-end/Settings.js
Source/WebCore/inspector/front-end/externs.js
Source/WebCore/inspector/front-end/inspector.js
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
Source/WebKit/chromium/src/InspectorFrontendClientImpl.h

index e89ac47..ab04309 100644 (file)
@@ -1,3 +1,31 @@
+2013-03-13  Pavel Feldman  <pfeldman@chromium.org>
+
+        Web Inspector: convert workers inspection into capability
+        https://bugs.webkit.org/show_bug.cgi?id=112251
+
+        Reviewed by Vsevolod Vlasov.
+
+        It should be up to backend
+
+        * inspector/Inspector.json:
+        * inspector/InspectorFrontendClient.h:
+        (InspectorFrontendClient):
+        * inspector/InspectorFrontendClientLocal.h:
+        * inspector/InspectorFrontendHost.cpp:
+        * inspector/InspectorFrontendHost.h:
+        (InspectorFrontendHost):
+        * inspector/InspectorFrontendHost.idl:
+        * inspector/InspectorWorkerAgent.cpp:
+        (WebCore::InspectorWorkerAgent::canInspectWorkers):
+        (WebCore):
+        * inspector/InspectorWorkerAgent.h:
+        (InspectorWorkerAgent):
+        * inspector/front-end/InspectorFrontendHostStub.js:
+        * inspector/front-end/Settings.js:
+        * inspector/front-end/externs.js:
+        * inspector/front-end/inspector.js:
+        (WebInspector.doLoadedDone):
+
 2013-03-13  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
 
         [EFL] Start using evas object directly in Widget class
index 0c6d1d5..ca833d5 100644 (file)
                 ]
             },
             {
+                "name": "canInspectWorkers",
+                "description": "Tells whether browser supports workers inspection.",
+                "returns": [
+                    { "name": "result", "type": "boolean", "description": "True if browser has workers support." }
+                ]
+            },
+            {
                 "name": "connectToWorker",
                 "parameters": [
                     { "name": "workerId", "type": "integer" }
index ad08d3f..2bca83f 100644 (file)
@@ -66,7 +66,6 @@ public:
     virtual bool canSave() = 0;
     virtual void save(const WTF::String& url, const WTF::String& content, bool forceSaveAs) = 0;
     virtual void append(const WTF::String& url, const WTF::String& content) = 0;
-    virtual bool canInspectWorkers() = 0;
 
     virtual void inspectedURLChanged(const String&) = 0;
 
index a520d3d..8b3a178 100644 (file)
@@ -69,7 +69,6 @@ public:
     virtual bool canSave() { return false; }
     virtual void save(const String&, const String&, bool) { }
     virtual void append(const String&, const String&) { }
-    virtual bool canInspectWorkers() { return false; }
 
     virtual void attachWindow() = 0;
     virtual void detachWindow() = 0;
index 818ec22..743407a 100644 (file)
@@ -250,17 +250,6 @@ void InspectorFrontendHost::close(const String&)
 {
 }
 
-bool InspectorFrontendHost::canInspectWorkers()
-{
-#if ENABLE(WORKERS)
-    if (m_client)
-        return m_client->canInspectWorkers();
-    return false;
-#else
-    return false;
-#endif
-}
-
 void InspectorFrontendHost::sendMessageToBackend(const String& message)
 {
     if (m_client)
index 00ce917..4aa243f 100644 (file)
@@ -78,8 +78,6 @@ public:
     void append(const String& url, const String& content);
     void close(const String& url);
 
-    bool canInspectWorkers();
-
     // Called from [Custom] implementations.
     void showContextMenu(Event*, const Vector<ContextMenuItem>& items);
     void sendMessageToBackend(const String& message);
index a3ba8df..2b628c1 100644 (file)
@@ -55,8 +55,6 @@
     void append(in DOMString url, in DOMString content);
     void close(in DOMString url);
 
-    boolean canInspectWorkers();
-
     [Custom] DOMString platform();
     [Custom] DOMString port();
     [Custom] void showContextMenu(in MouseEvent event, in any items);
@@ -65,7 +63,7 @@
     [Custom] void recordActionTaken(in unsigned long actionCode);
     [Custom] void recordPanelShown(in unsigned long panelCode);
     [Custom] void recordSettingChanged(in unsigned long settingChanged);
-    
+
     DOMString loadResourceSynchronously(in DOMString url);
 
     boolean supportsFileSystems();
index d467ef8..385de9f 100644 (file)
@@ -158,6 +158,15 @@ void InspectorWorkerAgent::disable(ErrorString*)
     destroyWorkerFrontendChannels();
 }
 
+void InspectorWorkerAgent::canInspectWorkers(ErrorString*, bool* result)
+{
+#if ENABLE(WORKERS)
+    *result = true;
+#else
+    *result = false;
+#endif
+}
+
 void InspectorWorkerAgent::connectToWorker(ErrorString* error, int workerId)
 {
     WorkerFrontendChannel* channel = m_idToChannel.get(workerId);
index b948817..1599c43 100644 (file)
@@ -64,6 +64,7 @@ public:
     // Called from InspectorBackendDispatcher
     virtual void enable(ErrorString*);
     virtual void disable(ErrorString*);
+    virtual void canInspectWorkers(ErrorString*, bool*);
     virtual void connectToWorker(ErrorString*, int workerId);
     virtual void disconnectFromWorker(ErrorString*, int workerId);
     virtual void sendMessageToWorker(ErrorString*, int workerId, const RefPtr<InspectorObject>& message);
index 6f353d9..0d900e1 100644 (file)
@@ -221,11 +221,6 @@ WebInspector.InspectorFrontendHostStub.prototype = {
     {
     },
 
-    canInspectWorkers: function()
-    {
-        return true;
-    },
-
     isUnderTest: function()
     {
         return false;
index a38a32a..a6e20d6 100755 (executable)
@@ -115,7 +115,7 @@ WebInspector.ScriptsPanel = function(workspaceForTest)
     this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSidebarPane();
     this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerBreakpointsSidebarPane();
 
-    if (InspectorFrontendHost.canInspectWorkers() && !WebInspector.WorkerManager.isWorkerFrontend()) {
+    if (Capabilities.canInspectWorkers && !WebInspector.WorkerManager.isWorkerFrontend()) {
         WorkerAgent.enable();
         this.sidebarPanes.workerList = new WebInspector.WorkersSidebarPane(WebInspector.workerManager);
     }
@@ -1313,6 +1313,7 @@ WebInspector.ScriptsPanel.prototype = {
             group2.addPane(this.sidebarPanes.domBreakpoints);
             group2.addPane(this.sidebarPanes.xhrBreakpoints);
             group2.addPane(this.sidebarPanes.eventListenerBreakpoints);
+            group2.addPane(this.sidebarPanes.workerList);
 
             this.sidebarPaneView.firstElement().appendChild(this.debugToolbar);
         }
index a36c8e3..e075118 100644 (file)
@@ -62,7 +62,8 @@ var Capabilities = {
     canOverrideDeviceOrientation: false,
     canShowDebugBorders: false,
     canShowFPSCounter: false,
-    canContinuouslyPaint: false
+    canContinuouslyPaint: false,
+    canInspectWorkers: false
 }
 
 /**
index c100d24..17bcc4c 100644 (file)
@@ -192,7 +192,6 @@ InspectorFrontendHostAPI.prototype.addFileSystem = function() {}
 InspectorFrontendHostAPI.prototype.removeFileSystem = function(fileSystemPath) {}
 InspectorFrontendHostAPI.prototype.isolatedFileSystem = function(fileSystemId, registeredName) {}
 InspectorFrontendHostAPI.prototype.setZoomFactor = function(zoom) {}
-InspectorFrontendHostAPI.prototype.canInspectWorkers = function() {}
 /** @type {InspectorFrontendHostAPI} */
 var InspectorFrontendHost;
 
index 86077cd..76530f6 100644 (file)
@@ -408,6 +408,7 @@ WebInspector.doLoadedDone = function()
     PageAgent.canContinuouslyPaint(WebInspector._initializeCapability.bind(WebInspector, "canContinuouslyPaint", null));
     PageAgent.canOverrideDeviceMetrics(WebInspector._initializeCapability.bind(WebInspector, "canOverrideDeviceMetrics", null));
     PageAgent.canOverrideGeolocation(WebInspector._initializeCapability.bind(WebInspector, "canOverrideGeolocation", null));
+    WorkerAgent.canInspectWorkers(WebInspector._initializeCapability.bind(WebInspector, "canInspectWorkers", null));
     PageAgent.canOverrideDeviceOrientation(WebInspector._initializeCapability.bind(WebInspector, "canOverrideDeviceOrientation", WebInspector._doLoadedDoneWithCapabilities.bind(WebInspector)));
 }
 
index ccb2d54..167cc34 100644 (file)
@@ -1,3 +1,14 @@
+2013-03-13  Pavel Feldman  <pfeldman@chromium.org>
+
+        Web Inspector: convert workers inspection into capability
+        https://bugs.webkit.org/show_bug.cgi?id=112251
+
+        Reviewed by Vsevolod Vlasov.
+
+        * src/InspectorFrontendClientImpl.cpp:
+        * src/InspectorFrontendClientImpl.h:
+        (InspectorFrontendClientImpl):
+
 2013-03-12  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed.  Rolled Chromium DEPS to r187688.  Requested by
index 3b672e0..dbec9ef 100644 (file)
@@ -139,11 +139,6 @@ void InspectorFrontendClientImpl::append(const String& url, const String& conten
     m_client->append(url, content);
 }
 
-bool InspectorFrontendClientImpl::canInspectWorkers()
-{
-    return true;
-}
-
 void InspectorFrontendClientImpl::inspectedURLChanged(const String& url)
 {
     m_frontendPage->mainFrame()->document()->setTitle("Developer Tools - " + url);
index afee003..c409b82 100644 (file)
@@ -70,7 +70,6 @@ public:
     virtual bool canSave();
     virtual void save(const WTF::String& urk, const WTF::String& content, bool forceSaveAs);
     virtual void append(const WTF::String& urk, const WTF::String& content);
-    virtual bool canInspectWorkers();
 
     virtual void inspectedURLChanged(const WTF::String&);