[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:04:01 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 157e3518849e525bc5d25630b7fac302a353f7c3
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Aug 13 12:08:21 2010 +0000

    2010-08-13  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: remove openInInspectorWindow and evaluateAndStringify from InjectedScript.
            https://bugs.webkit.org/show_bug.cgi?id=43854
    
            * inspector/Inspector.idl:
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::openInInspectedWindow):
            * inspector/InspectorController.h:
            * inspector/front-end/ExtensionServer.js:
            (WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage.callback):
            (WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage):
            * inspector/front-end/InjectedScript.js:
            (injectedScriptConstructor):
            * inspector/front-end/InjectedScriptAccess.js:
            * inspector/front-end/InspectorBackendStub.js:
            (WebInspector.InspectorBackendStub):
            * inspector/front-end/ResourcesPanel.js:
            (WebInspector.ResourceSidebarTreeElement.prototype.ondblclick):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65314 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index cec865d..7e8e14c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-08-13  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: remove openInInspectorWindow and evaluateAndStringify from InjectedScript.
+        https://bugs.webkit.org/show_bug.cgi?id=43854
+
+        * inspector/Inspector.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::openInInspectedWindow):
+        * inspector/InspectorController.h:
+        * inspector/front-end/ExtensionServer.js:
+        (WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage.callback):
+        (WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage):
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor):
+        * inspector/front-end/InjectedScriptAccess.js:
+        * inspector/front-end/InspectorBackendStub.js:
+        (WebInspector.InspectorBackendStub):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourceSidebarTreeElement.prototype.ondblclick):
+
 2010-08-13  Fumitoshi Ukai  <ukai at chromium.org>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index 9d3d102..2e14310 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -180,6 +180,7 @@ module core {
 
         [handler=Controller] void highlightDOMNode(in long nodeId);
         [handler=Controller] void hideDOMNodeHighlight();
+        [handler=Controller] void openInInspectedWindow(in String url);
 
         [handler=DOM] void getStyles(in long callId, in long nodeId, in boolean authOnly, out Value styles);
         [handler=DOM] void getAllStyles(in long callId, out Array styles);
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 993fed4..4948679 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -46,6 +46,7 @@
 #include "FloatQuad.h"
 #include "FloatRect.h"
 #include "Frame.h"
+#include "FrameLoadRequest.h"
 #include "FrameLoader.h"
 #include "FrameTree.h"
 #include "FrameView.h"
@@ -86,6 +87,7 @@
 #include "SharedBuffer.h"
 #include "TextEncoding.h"
 #include "TextIterator.h"
+#include "WindowFeatures.h"
 #include <wtf/text/CString.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/ListHashSet.h>
@@ -1868,6 +1870,22 @@ void InspectorController::drawNodeHighlight(GraphicsContext& context) const
     }
 }
 
+void InspectorController::openInInspectedWindow(const String& url)
+{
+    ResourceRequest request;
+    FrameLoadRequest frameRequest(request, "_blank");
+    bool created;
+    Frame* mainFrame = m_inspectedPage->mainFrame();
+    WindowFeatures windowFeatures;
+    Frame* newFrame = WebCore::createWindow(mainFrame, mainFrame, frameRequest, windowFeatures, created);
+    if (!newFrame)
+        return;
+
+    newFrame->loader()->setOpener(mainFrame);
+    newFrame->page()->setOpenedByDOM();
+    newFrame->loader()->changeLocation(newFrame->loader()->completeURL(url), "", false, false, true);
+}
+
 void InspectorController::count(const String& title, unsigned lineNumber, const String& sourceID)
 {
     String identifier = title + String::format("@%s:%d", sourceID.utf8().data(), lineNumber);
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 622e1c4..54d7c78 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -212,6 +212,7 @@ public:
     bool hasFrontend() const { return m_remoteFrontend; }
 
     void drawNodeHighlight(GraphicsContext&) const;
+    void openInInspectedWindow(const String& url);
 
     void count(const String& title, unsigned lineNumber, const String& sourceID);
 
@@ -252,6 +253,7 @@ public:
     void evaluateForTestInFrontend(long testCallId, const String& script);
 
     InjectedScript injectedScriptForNodeId(long id);
+
     void addScriptToEvaluateOnLoad(const String& source);
     void removeAllScriptsToEvaluateOnLoad();
     void setInspectorExtensionAPI(const String& source);
diff --git a/WebCore/inspector/front-end/ExtensionServer.js b/WebCore/inspector/front-end/ExtensionServer.js
index 2abe1db..04a8196 100644
--- a/WebCore/inspector/front-end/ExtensionServer.js
+++ b/WebCore/inspector/front-end/ExtensionServer.js
@@ -193,7 +193,17 @@ WebInspector.ExtensionServer.prototype = {
 
     _onEvaluateOnInspectedPage: function(message, port)
     {
-        InjectedScriptAccess.getDefault().evaluateAndStringify(message.expression, this._dispatchCallback.bind(this, message.requestId, port));
+        var escapedMessage = escape(message.expression);
+        function callback(resultPayload)
+        {
+            var resultObject = WebInspector.RemoteObject.fromPayload(resultPayload);
+            var result = {};
+            if (resultObject.isError())
+                result.isException = true;
+            result.value = resultObject.description;
+            this._dispatchCallback(message.requestId, port, result);
+        }
+        InjectedScriptAccess.getDefault().evaluate("(function() { var a = window.eval(unescape(\"" + escapedMessage + "\")); return JSON.stringify(a); })();", "", callback.bind(this));
     },
 
     _onRevealAndSelect: function(message)
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index c4f3afb..fa0ba63 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -80,11 +80,9 @@ InjectedScript.releaseWrapperObjectGroup = function(objectGroupName) {
     delete InjectedScript.objectGroups[objectGroupName];
 };
 
-InjectedScript.dispatch = function(methodName, args, callId)
+InjectedScript.dispatch = function(methodName, args)
 {
     var argsArray = eval("(" + args + ")");
-    if (callId)
-        argsArray.splice(0, 0, callId);  // Methods that run asynchronously have a call back id parameter.
     var result = InjectedScript[methodName].apply(InjectedScript, argsArray);
     if (typeof result === "undefined") {
         inspectedWindow.console.error("Web Inspector error: InjectedScript.%s returns undefined", methodName);
@@ -236,19 +234,6 @@ InjectedScript.getCompletions = function(expression, includeInspectorCommandLine
     return props;
 }
 
-InjectedScript.evaluateAndStringify = function(expression)
-{
-    var result = {};
-    try {
-        var value = InjectedScript._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false);
-        result.value = JSON.stringify(value);
-    } catch (e) {
-        result.value = e.toString();
-        result.isException = true;
-    }
-    return result;
-}
-
 InjectedScript.evaluate = function(expression, objectGroup)
 {
     return InjectedScript._evaluateAndWrap(inspectedWindow.eval, inspectedWindow, expression, objectGroup);
@@ -292,14 +277,6 @@ InjectedScript.getNodeId = function(node)
     return InjectedScriptHost.pushNodePathToFrontend(node, false, false);
 }
 
-InjectedScript.openInInspectedWindow = function(url)
-{
-    // Don't call window.open on wrapper - popup blocker mutes it.
-    // URIs should have no double quotes.
-    inspectedWindow.eval("window.open(\"" + url + "\")");
-    return true;
-}
-
 InjectedScript.callFrames = function()
 {
     var callFrame = InjectedScriptHost.currentCallFrame();
diff --git a/WebCore/inspector/front-end/InjectedScriptAccess.js b/WebCore/inspector/front-end/InjectedScriptAccess.js
index b5aa9c7..1385ecb 100644
--- a/WebCore/inspector/front-end/InjectedScriptAccess.js
+++ b/WebCore/inspector/front-end/InjectedScriptAccess.js
@@ -75,12 +75,10 @@ InjectedScriptAccess._installHandler = function(methodName, async)
 // - Make sure last parameter of all the InjectedSriptAccess.* calls is a callback function.
 // We keep these sorted.
 InjectedScriptAccess._installHandler("evaluate");
-InjectedScriptAccess._installHandler("evaluateAndStringify");
 InjectedScriptAccess._installHandler("evaluateInCallFrame");
 InjectedScriptAccess._installHandler("evaluateOnSelf");
 InjectedScriptAccess._installHandler("getCompletions");
 InjectedScriptAccess._installHandler("getProperties");
 InjectedScriptAccess._installHandler("getPrototypes");
-InjectedScriptAccess._installHandler("openInInspectedWindow");
 InjectedScriptAccess._installHandler("pushNodeToFrontend");
 InjectedScriptAccess._installHandler("setPropertyValue");
diff --git a/WebCore/inspector/front-end/InspectorBackendStub.js b/WebCore/inspector/front-end/InspectorBackendStub.js
index 8652dd4..8216326 100644
--- a/WebCore/inspector/front-end/InspectorBackendStub.js
+++ b/WebCore/inspector/front-end/InspectorBackendStub.js
@@ -84,6 +84,7 @@ WebInspector.InspectorBackendStub = function()
     this._registerDelegate("storeLastActivePanel");
     this._registerDelegate("takeHeapSnapshot");
     this._registerDelegate("getProfilerLogLines");
+    this._registerDelegate("openInInspectedWindow");
 
     this._registerDelegate("getAllStyles");
     this._registerDelegate("getStyles");
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index 9785644..01eefc7 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -1186,7 +1186,7 @@ WebInspector.ResourceSidebarTreeElement.prototype = {
     
     ondblclick: function(event)
     {
-        InjectedScriptAccess.getDefault().openInInspectedWindow(this.resource.url, function() {});
+        InspectorBackend.openInInspectedWindow(this.resource.url);
     },
 
     ondragstart: function(event) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list