[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

pfeldman at chromium.org pfeldman at chromium.org
Wed Dec 22 12:09:03 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 760ab44eb435c91a881333aebe759026f12f925c
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Aug 16 12:23:47 2010 +0000

    2010-08-16  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Joseph Pecoraro.
    
            Web Inspector: upstream frontend-side WebSocket transport.
            https://bugs.webkit.org/show_bug.cgi?id=43970
    
            Chromium already has an alternate WebSocket-based communication channel with
            the backend. Upstreaming it in this change. We will agree on the URI
            of the remote service as the protocol matures.
    
            * inspector/front-end/inspector.js:
            (.WebInspector.socket.onmessage):
            (.WebInspector.socket.onerror):
            (.WebInspector.socket.onopen):
            (WebInspector.loaded):
            (WebInspector.doLoadedDone):
            (WebInspector_syncDispatch):
    2010-08-16  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Joseph Pecoraro.
    
            Web Inspector: upstream frontend-side WebSocket transport.
            https://bugs.webkit.org/show_bug.cgi?id=43970
    
            Chromium already has an alternate WebSocket-based communication channel with
            the backend. Upstreaming it in this change. We will agree on the URI
            of the remote service as the protocol matures.
    
            * src/WebDevToolsFrontendImpl.cpp:
            (WebKit::WebDevToolsFrontendImpl::dispatchOnInspectorFrontend):
            * src/js/DevTools.js:
            (WebInspector.loaded):
            (devtools.domContentLoaded):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65415 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3a544a6..97de904 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,24 @@
 2010-08-16  Pavel Feldman  <pfeldman at chromium.org>
 
+        Reviewed by Joseph Pecoraro.
+
+        Web Inspector: upstream frontend-side WebSocket transport.
+        https://bugs.webkit.org/show_bug.cgi?id=43970
+
+        Chromium already has an alternate WebSocket-based communication channel with
+        the backend. Upstreaming it in this change. We will agree on the URI
+        of the remote service as the protocol matures.
+
+        * inspector/front-end/inspector.js:
+        (.WebInspector.socket.onmessage):
+        (.WebInspector.socket.onerror):
+        (.WebInspector.socket.onopen):
+        (WebInspector.loaded):
+        (WebInspector.doLoadedDone):
+        (WebInspector_syncDispatch):
+
+2010-08-16  Pavel Feldman  <pfeldman at chromium.org>
+
         Reviewed by Yury Semikhatsky.
 
         Web Inspector: Make InjectedScript proto-based.
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 42e1355..aea7d22 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -28,7 +28,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-function preloadImages()
+(function preloadImages()
 {
     (new Image()).src = "Images/clearConsoleButtonGlyph.png";
     (new Image()).src = "Images/consoleButtonGlyph.png";
@@ -45,9 +45,7 @@ function preloadImages()
     (new Image()).src = "Images/recordToggledButtonGlyph.png";
     (new Image()).src = "Images/reloadButtonGlyph.png";
     (new Image()).src = "Images/undockButtonGlyph.png";
-}
-
-preloadImages();
+})();
 
 var WebInspector = {
     resources: {},
@@ -427,10 +425,39 @@ WebInspector.PlatformFlavor = {
     MacTiger: "mac-tiger",
     MacLeopard: "mac-leopard",
     MacSnowLeopard: "mac-snowleopard"
-}
+};
+
+(function parseQueryParameters()
+{
+    WebInspector.queryParamsObject = {};
+    var queryParams = window.location.search;
+    if (!queryParams)
+        return;
+    var params = queryParams.substring(1).split("&");
+    for (var i = 0; i < params.length; ++i) {
+        var pair = params[i].split("=");
+        WebInspector.queryParamsObject[pair[0]] = pair[1];
+    }
+})();
 
 WebInspector.loaded = function()
 {
+    if ("page" in WebInspector.queryParamsObject) {
+        WebInspector.socket = new WebSocket("ws://" + window.location.host + "/devtools/page/" + WebInspector.queryParamsObject.page);
+        WebInspector.socket.onmessage = function(message) { WebInspector_syncDispatch(message.data); }
+        WebInspector.socket.onerror = function(error) { console.error(error); }
+        WebInspector.socket.onopen = function() {
+            InspectorFrontendHost.sendMessageToBackend = WebInspector.socket.send.bind(WebInspector.socket);
+            InspectorFrontendHost.loaded = WebInspector.socket.send.bind(WebInspector.socket, "loaded");
+            WebInspector.doLoadedDone();
+        }
+        return;
+    }
+    WebInspector.doLoadedDone();
+}
+
+WebInspector.doLoadedDone = function()
+{
     InspectorBackend.setInjectedScriptSource("(" + injectedScriptConstructor + ");");
 
     var platform = WebInspector.platform;
@@ -581,6 +608,15 @@ WebInspector.dispatch = function() {
     setTimeout(delayDispatch, 0);
 }
 
+// This function is purposely put into the global scope for easy access.
+WebInspector_syncDispatch = function(message)
+{
+    var args = JSON.parse(message);
+    var methodName = args[0];
+    var parameters = args.slice(1);
+    WebInspector[methodName].apply(WebInspector, parameters);
+}
+
 WebInspector.dispatchMessageFromBackend = function(arguments)
 {
     WebInspector.dispatch.apply(this, arguments);
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 8c61067..dcc8039 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,20 @@
+2010-08-16  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Joseph Pecoraro.
+
+        Web Inspector: upstream frontend-side WebSocket transport.
+        https://bugs.webkit.org/show_bug.cgi?id=43970
+
+        Chromium already has an alternate WebSocket-based communication channel with
+        the backend. Upstreaming it in this change. We will agree on the URI
+        of the remote service as the protocol matures.
+
+        * src/WebDevToolsFrontendImpl.cpp:
+        (WebKit::WebDevToolsFrontendImpl::dispatchOnInspectorFrontend):
+        * src/js/DevTools.js:
+        (WebInspector.loaded):
+        (devtools.domContentLoaded):
+
 2010-08-16  Yury Semikhatsky  <yurys at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
index 40e11f7..905bc6d 100644
--- a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
+++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
@@ -112,7 +112,7 @@ void WebDevToolsFrontendImpl::dispatchOnInspectorFrontend(const WebString& messa
     v8::HandleScope scope;
     v8::Handle<v8::Context> frameContext = V8Proxy::context(frame->frame());
     v8::Context::Scope contextScope(frameContext);
-    v8::Handle<v8::Value> dispatchFunction = frameContext->Global()->Get(v8::String::New("devtools$$dispatch"));
+    v8::Handle<v8::Value> dispatchFunction = frameContext->Global()->Get(v8::String::New("WebInspector_syncDispatch"));
     ASSERT(dispatchFunction->IsFunction());
     v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(dispatchFunction);
     Vector< v8::Handle<v8::Value> > args;
diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js
index bdaa71a..0fd66c9 100644
--- a/WebKit/chromium/src/js/DevTools.js
+++ b/WebKit/chromium/src/js/DevTools.js
@@ -34,22 +34,6 @@
  * DevTools frontend together. It is also responsible for overriding existing
  * WebInspector functionality while it is getting upstreamed into WebCore.
  */
-
-/**
- * Dispatches raw message from the host.
- * @param {string} remoteName
- * @prama {string} methodName
- * @param {string} param1, param2, param3 Arguments to dispatch.
- */
-devtools$$dispatch = function(message)
-{
-    var args = typeof message === "string" ? JSON.parse(message) : message;
-    var methodName = args[0];
-    var parameters = args.slice(1);
-    WebInspector[methodName].apply(WebInspector, parameters);
-};
-
-
 devtools.ToolsAgent = function()
 {
     this.profilerAgent_ = new devtools.ProfilerAgent();
@@ -75,30 +59,6 @@ devtools.tools = null;
 
 var context = {};  // Used by WebCore's inspector routines.
 
-(function() {
-    WebInspector._paramsObject = {};
-
-    var queryParams = window.location.search;
-    if (queryParams) {
-        var params = queryParams.substring(1).split("&");
-        for (var i = 0; i < params.length; ++i) {
-            var pair = params[i].split("=");
-            WebInspector._paramsObject[pair[0]] = pair[1];
-        }
-    }
-    if ("page" in WebInspector._paramsObject) {
-        WebInspector.socket = new WebSocket("ws://" + window.location.host + "/devtools/page/" + WebInspector._paramsObject.page);
-        WebInspector.socket.onmessage = function(message) { devtools$$dispatch(message.data); }
-        WebInspector.socket.onerror = function(error) { console.err(error); }
-        WebInspector.socket.onopen = function() {
-            WebInspector.socketOpened = true;
-            if (WebInspector.loadedDone)
-                WebInspector.doLoadedDone();
-        };
-        InspectorFrontendHost.sendMessageToBackend = WebInspector.socket.send.bind(WebInspector.socket);
-        InspectorFrontendHost.loaded = WebInspector.socket.send.bind(WebInspector.socket, "loaded");
-    }
-})();
 ///////////////////////////////////////////////////////////////////////////////
 // Here and below are overrides to existing WebInspector methods only.
 // TODO(pfeldman): Patch WebCore and upstream changes.
@@ -114,24 +74,15 @@ WebInspector.loaded = function()
     Preferences.profilerAlwaysEnabled = true;
     Preferences.canEditScriptSource = true;
     Preferences.onlineDetectionEnabled = false;
-    if ("page" in WebInspector._paramsObject) {
-        WebInspector.loadedDone = true;
-        if (WebInspector.socketOpened)
-            WebInspector.doLoadedDone();
-        return;
-    }
-    WebInspector.doLoadedDone();
-}
 
-WebInspector.doLoadedDone = function() {
-    oldLoaded.call(this);
+    oldLoaded.call(WebInspector);
 }
 
 devtools.domContentLoaded = function()
 {
-    WebInspector.setAttachedWindow(WebInspector._paramsObject.docked === "true");
-    if (WebInspector._paramsObject.toolbar_color && WebInspector._paramsObject.text_color)
-        WebInspector.setToolbarColors(WebInspector._paramsObject.toolbar_color, WebInspector._paramsObject.text_color);
+    WebInspector.setAttachedWindow(WebInspector.queryParamsObject.docked === "true");
+    if (WebInspector.queryParamsObject.toolbar_color && WebInspector.queryParamsObject.text_color)
+        WebInspector.setToolbarColors(WebInspector.queryParamsObject.toolbar_color, WebInspector.queryParamsObject.text_color);
 }
 document.addEventListener("DOMContentLoaded", devtools.domContentLoaded, false);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list