Changeset 65314 in webkit
- Timestamp:
- Aug 13, 2010 5:08:21 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65313 r65314 1 2010-08-13 Pavel Feldman <pfeldman@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: remove openInInspectorWindow and evaluateAndStringify from InjectedScript. 6 https://bugs.webkit.org/show_bug.cgi?id=43854 7 8 * inspector/Inspector.idl: 9 * inspector/InspectorController.cpp: 10 (WebCore::InspectorController::openInInspectedWindow): 11 * inspector/InspectorController.h: 12 * inspector/front-end/ExtensionServer.js: 13 (WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage.callback): 14 (WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage): 15 * inspector/front-end/InjectedScript.js: 16 (injectedScriptConstructor): 17 * inspector/front-end/InjectedScriptAccess.js: 18 * inspector/front-end/InspectorBackendStub.js: 19 (WebInspector.InspectorBackendStub): 20 * inspector/front-end/ResourcesPanel.js: 21 (WebInspector.ResourceSidebarTreeElement.prototype.ondblclick): 22 1 23 2010-08-13 Fumitoshi Ukai <ukai@chromium.org> 2 24 -
trunk/WebCore/inspector/Inspector.idl
r65072 r65314 181 181 [handler=Controller] void highlightDOMNode(in long nodeId); 182 182 [handler=Controller] void hideDOMNodeHighlight(); 183 [handler=Controller] void openInInspectedWindow(in String url); 183 184 184 185 [handler=DOM] void getStyles(in long callId, in long nodeId, in boolean authOnly, out Value styles); -
trunk/WebCore/inspector/InspectorController.cpp
r65073 r65314 47 47 #include "FloatRect.h" 48 48 #include "Frame.h" 49 #include "FrameLoadRequest.h" 49 50 #include "FrameLoader.h" 50 51 #include "FrameTree.h" … … 87 88 #include "TextEncoding.h" 88 89 #include "TextIterator.h" 90 #include "WindowFeatures.h" 89 91 #include <wtf/text/CString.h> 90 92 #include <wtf/CurrentTime.h> … … 1869 1871 } 1870 1872 1873 void InspectorController::openInInspectedWindow(const String& url) 1874 { 1875 ResourceRequest request; 1876 FrameLoadRequest frameRequest(request, "_blank"); 1877 bool created; 1878 Frame* mainFrame = m_inspectedPage->mainFrame(); 1879 WindowFeatures windowFeatures; 1880 Frame* newFrame = WebCore::createWindow(mainFrame, mainFrame, frameRequest, windowFeatures, created); 1881 if (!newFrame) 1882 return; 1883 1884 newFrame->loader()->setOpener(mainFrame); 1885 newFrame->page()->setOpenedByDOM(); 1886 newFrame->loader()->changeLocation(newFrame->loader()->completeURL(url), "", false, false, true); 1887 } 1888 1871 1889 void InspectorController::count(const String& title, unsigned lineNumber, const String& sourceID) 1872 1890 { -
trunk/WebCore/inspector/InspectorController.h
r65258 r65314 213 213 214 214 void drawNodeHighlight(GraphicsContext&) const; 215 void openInInspectedWindow(const String& url); 215 216 216 217 void count(const String& title, unsigned lineNumber, const String& sourceID); … … 253 254 254 255 InjectedScript injectedScriptForNodeId(long id); 256 255 257 void addScriptToEvaluateOnLoad(const String& source); 256 258 void removeAllScriptsToEvaluateOnLoad(); -
trunk/WebCore/inspector/front-end/ExtensionServer.js
r64973 r65314 194 194 _onEvaluateOnInspectedPage: function(message, port) 195 195 { 196 InjectedScriptAccess.getDefault().evaluateAndStringify(message.expression, this._dispatchCallback.bind(this, message.requestId, port)); 196 var escapedMessage = escape(message.expression); 197 function callback(resultPayload) 198 { 199 var resultObject = WebInspector.RemoteObject.fromPayload(resultPayload); 200 var result = {}; 201 if (resultObject.isError()) 202 result.isException = true; 203 result.value = resultObject.description; 204 this._dispatchCallback(message.requestId, port, result); 205 } 206 InjectedScriptAccess.getDefault().evaluate("(function() { var a = window.eval(unescape(\"" + escapedMessage + "\")); return JSON.stringify(a); })();", "", callback.bind(this)); 197 207 }, 198 208 -
trunk/WebCore/inspector/front-end/InjectedScript.js
r65300 r65314 81 81 }; 82 82 83 InjectedScript.dispatch = function(methodName, args , callId)83 InjectedScript.dispatch = function(methodName, args) 84 84 { 85 85 var argsArray = eval("(" + args + ")"); 86 if (callId)87 argsArray.splice(0, 0, callId); // Methods that run asynchronously have a call back id parameter.88 86 var result = InjectedScript[methodName].apply(InjectedScript, argsArray); 89 87 if (typeof result === "undefined") { … … 237 235 } 238 236 239 InjectedScript.evaluateAndStringify = function(expression)240 {241 var result = {};242 try {243 var value = InjectedScript._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false);244 result.value = JSON.stringify(value);245 } catch (e) {246 result.value = e.toString();247 result.isException = true;248 }249 return result;250 }251 252 237 InjectedScript.evaluate = function(expression, objectGroup) 253 238 { … … 291 276 { 292 277 return InjectedScriptHost.pushNodePathToFrontend(node, false, false); 293 }294 295 InjectedScript.openInInspectedWindow = function(url)296 {297 // Don't call window.open on wrapper - popup blocker mutes it.298 // URIs should have no double quotes.299 inspectedWindow.eval("window.open(\"" + url + "\")");300 return true;301 278 } 302 279 -
trunk/WebCore/inspector/front-end/InjectedScriptAccess.js
r65072 r65314 76 76 // We keep these sorted. 77 77 InjectedScriptAccess._installHandler("evaluate"); 78 InjectedScriptAccess._installHandler("evaluateAndStringify");79 78 InjectedScriptAccess._installHandler("evaluateInCallFrame"); 80 79 InjectedScriptAccess._installHandler("evaluateOnSelf"); … … 82 81 InjectedScriptAccess._installHandler("getProperties"); 83 82 InjectedScriptAccess._installHandler("getPrototypes"); 84 InjectedScriptAccess._installHandler("openInInspectedWindow");85 83 InjectedScriptAccess._installHandler("pushNodeToFrontend"); 86 84 InjectedScriptAccess._installHandler("setPropertyValue"); -
trunk/WebCore/inspector/front-end/InspectorBackendStub.js
r65075 r65314 85 85 this._registerDelegate("takeHeapSnapshot"); 86 86 this._registerDelegate("getProfilerLogLines"); 87 this._registerDelegate("openInInspectedWindow"); 87 88 88 89 this._registerDelegate("getAllStyles"); -
trunk/WebCore/inspector/front-end/ResourcesPanel.js
r65052 r65314 1187 1187 ondblclick: function(event) 1188 1188 { 1189 In jectedScriptAccess.getDefault().openInInspectedWindow(this.resource.url, function() {});1189 InspectorBackend.openInInspectedWindow(this.resource.url); 1190 1190 }, 1191 1191
Note: See TracChangeset
for help on using the changeset viewer.