diff options
author | Kristian Monsen <kristianm@google.com> | 2010-07-30 10:46:49 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-08-04 13:01:34 +0100 |
commit | 0617145a89917ae7735fe1c9538688ab9a577df5 (patch) | |
tree | 56206078694427c37ed7bdf27eb5221398b833c0 /WebKit/chromium/src/js/DevTools.js | |
parent | ef1adcdfc805d4d13103f6f15cc5b4d96828a60f (diff) | |
download | external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.zip external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.gz external_webkit-0617145a89917ae7735fe1c9538688ab9a577df5.tar.bz2 |
Merge WebKit at r64264 : Initial merge by git.
Change-Id: Ic42bef02efef8217a0f84c47176a9c617c28d1f1
Diffstat (limited to 'WebKit/chromium/src/js/DevTools.js')
-rw-r--r-- | WebKit/chromium/src/js/DevTools.js | 59 |
1 files changed, 44 insertions, 15 deletions
diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js index 35cca2f..640474b 100644 --- a/WebKit/chromium/src/js/DevTools.js +++ b/WebKit/chromium/src/js/DevTools.js @@ -93,7 +93,7 @@ devtools.ToolsAgent.prototype.getProfilerAgent = function() */ devtools.ToolsAgent.prototype.dispatchOnClient_ = function(message) { - var args = JSON.parse(message); + var args = typeof message === "string" ? JSON.parse(message) : message; var methodName = args[0]; var parameters = args.slice(1); WebInspector[methodName].apply(WebInspector, parameters); @@ -129,6 +129,28 @@ 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) { eval(message.data); } + WebInspector.socket.onerror = function(error) { console.err(error); } + WebInspector.socket.onopen = function() { + WebInspector.socketOpened = true; + if (WebInspector.loadedDone) + WebInspector.doLoadedDone(); + }; + } +})(); /////////////////////////////////////////////////////////////////////////////// // Here and below are overrides to existing WebInspector methods only. // TODO(pfeldman): Patch WebCore and upstream changes. @@ -145,25 +167,25 @@ WebInspector.loaded = function() Preferences.canEditScriptSource = true; Preferences.appCacheEnabled = false; - oldLoaded.call(this); + if ("page" in WebInspector._paramsObject) { + WebInspector.loadedDone = true; + if (WebInspector.socketOpened) + WebInspector.doLoadedDone(); + return; + } + WebInspector.doLoadedDone(); +} +WebInspector.doLoadedDone = function() { + oldLoaded.call(this); InspectorFrontendHost.loaded(); -}; +} devtools.domContentLoaded = function() { - var queryParams = window.location.search; - if (queryParams) { - var params = queryParams.substring(1).split("&"); - var paramsObject = {}; - for (var i = 0; i < params.length; ++i) { - var pair = params[i].split("="); - paramsObject[pair[0]] = pair[1]; - } - WebInspector.setAttachedWindow(paramsObject.docked === "true"); - if (paramsObject.toolbar_color && paramsObject.text_color) - WebInspector.setToolbarColors(paramsObject.toolbar_color, paramsObject.text_color); - } + 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); } document.addEventListener("DOMContentLoaded", devtools.domContentLoaded, false); @@ -275,3 +297,10 @@ WebInspector.resetToolbarColors = function() if (window.RemoteDebuggerAgent) { RemoteDebuggerAgent.setContextId = function() {}; } + + +// Support for pause while renderer is busy (is dispatched on IO thread). +InspectorBackend.pause = function() +{ + RemoteDebuggerCommandExecutor.DebuggerPauseScript(); +}; |