Changeset 54592 in webkit
- Timestamp:
- Feb 10, 2010 2:25:47 AM (14 years ago)
- Location:
- trunk/WebKit/chromium
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r54589 r54592 1 2010-02-10 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Use v8::Debug::ProcessDebugMessages instead of executing an empty function 6 7 https://bugs.webkit.org/show_bug.cgi?id=34704 8 9 * src/DebuggerAgent.h: 10 * src/DebuggerAgentImpl.cpp: 11 (WebKit::DebuggerAgentImpl::processDebugCommands): 12 * src/DebuggerAgentImpl.h: 13 * src/ToolsAgent.h: 14 * src/WebDevToolsAgentImpl.cpp: 15 * src/WebDevToolsAgentImpl.h: 16 * src/js/DebuggerAgent.js: 17 (devtools.DebuggerAgent.prototype.addBreakpoint): 18 * src/js/DevToolsHostStub.js: 19 (.RemoteDebuggerAgentStub.prototype.processDebugCommands): 20 * src/js/InjectDispatch.js: 21 (dispatch): 22 * src/js/ProfilerAgent.js: 23 (devtools.ProfilerAgent.prototype.startProfiling): 24 (devtools.ProfilerAgent.prototype.stopProfiling): 25 * src/js/Tests.js: 26 1 27 2010-02-10 Tony Chang <tony@chromium.org> 2 28 -
trunk/WebKit/chromium/src/DebuggerAgent.h
r54232 r54592 38 38 #define DEBUGGER_AGENT_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \ 39 39 /* Requests global context id of the inspected tab. */ \ 40 METHOD0(getContextId) 40 METHOD0(getContextId) \ 41 \ 42 /* Request v8 to process all debug commands in the queue. */ \ 43 METHOD0(processDebugCommands) 41 44 42 45 DEFINE_RPC_CLASS(DebuggerAgent, DEBUGGER_AGENT_STRUCT) -
trunk/WebKit/chromium/src/DebuggerAgentImpl.cpp
r54349 r54592 78 78 { 79 79 m_delegate->setContextId(m_webdevtoolsAgent->hostId()); 80 } 81 82 void DebuggerAgentImpl::processDebugCommands() 83 { 84 DebuggerAgentManager::UtilityContextScope utilityScope; 85 v8::Debug::ProcessDebugMessages(); 80 86 } 81 87 … … 180 186 } 181 187 182 void DebuggerAgentImpl::executeVoidJavaScript(v8::Handle<v8::Context> context)183 {184 v8::HandleScope scope;185 ASSERT(!context.IsEmpty());186 v8::Context::Scope contextScope(context);187 DebuggerAgentManager::UtilityContextScope utilityScope;188 189 v8::Handle<v8::Value> function =190 context->Global()->Get(v8::String::New("devtools$$void"));191 ASSERT(function->IsFunction());192 v8::Handle<v8::Value> args[] = {193 v8::Local<v8::Value>()194 };195 v8::Handle<v8::Function>::Cast(function)->Call(context->Global(), 0, args);196 }197 198 188 WebCore::Page* DebuggerAgentImpl::page() 199 189 { -
trunk/WebKit/chromium/src/DebuggerAgentImpl.h
r54232 r54592 63 63 // DebuggerAgent implementation. 64 64 virtual void getContextId(); 65 virtual void processDebugCommands(); 65 66 66 67 void debuggerOutput(const WebCore::String& out); … … 82 83 WebCore::String* exception); 83 84 84 // Executes a no-op function in the utility context. We don't use85 // executeUtilityFunction for that to avoid script evaluation leading to86 // undesirable AfterCompile events.87 void executeVoidJavaScript(v8::Handle<v8::Context> context);88 85 89 86 WebCore::Page* page(); -
trunk/WebKit/chromium/src/ToolsAgent.h
r54232 r54592 39 39 // API for auxiliary UI functions such as dom elements highlighting. 40 40 #define TOOLS_AGENT_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \ 41 /* Request the agent to to run a no-op JavaScript function to trigger v8 execution. */ \42 METHOD0(executeVoidJavaScript) \43 \44 41 /* Dispatches given function on the InspectorController object */ \ 45 42 METHOD3(dispatchOnInspectorController, int /* call_id */, \ -
trunk/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
r54425 r54592 266 266 } 267 267 268 void WebDevToolsAgentImpl::executeVoidJavaScript()269 {270 m_debuggerAgentImpl->executeVoidJavaScript(m_utilityContext);271 }272 273 268 void WebDevToolsAgentImpl::dispatchMessageFromFrontend(const WebDevToolsMessageData& data) 274 269 { -
trunk/WebKit/chromium/src/WebDevToolsAgentImpl.h
r54232 r54592 71 71 virtual void dispatchOnInspectorController(int callId, const WebCore::String& functionName, const WebCore::String& jsonArgs); 72 72 virtual void dispatchOnInjectedScript(int callId, int injectedScriptId, const WebCore::String& functionName, const WebCore::String& jsonArgs, bool async); 73 virtual void executeVoidJavaScript();74 73 75 74 // WebDevToolsAgentPrivate implementation. -
trunk/WebKit/chromium/src/js/DebuggerAgent.js
r54547 r54592 209 209 devtools.DebuggerAgent.sendCommand_(cmd); 210 210 // Force v8 execution so that it gets to processing the requested command. 211 Remote ToolsAgent.executeVoidJavaScript();211 RemoteDebuggerAgent.processDebugCommands(); 212 212 213 213 this.requestSeqToCallback_[cmd.getSequenceNumber()] = function(msg) { … … 291 291 // It is necessary for being able to change a breakpoint just after it 292 292 // has been created (since we need an existing breakpoint id for that). 293 Remote ToolsAgent.executeVoidJavaScript();293 RemoteDebuggerAgent.processDebugCommands(); 294 294 }; 295 295 … … 750 750 devtools.DebuggerAgent.sendCommand_(cmd); 751 751 // Force v8 execution so that it gets to processing the requested command. 752 Remote ToolsAgent.executeVoidJavaScript();752 RemoteDebuggerAgent.processDebugCommands(); 753 753 754 754 var debuggerAgent = this; -
trunk/WebKit/chromium/src/js/DevToolsHostStub.js
r54547 r54592 51 51 52 52 53 RemoteDebuggerAgentStub.prototype.processDebugCommands = function() 54 { 55 }; 56 57 53 58 /** 54 59 * @constructor … … 85 90 86 91 RemoteToolsAgentStub.prototype.dispatchOnInspectorController = function() 87 {88 };89 90 91 RemoteToolsAgentStub.prototype.executeVoidJavaScript = function()92 92 { 93 93 }; -
trunk/WebKit/chromium/src/js/InjectDispatch.js
r54547 r54592 105 105 DevToolsAgentHost.dispatch(call); 106 106 }; 107 108 /**109 * A no-op function that is called by debugger agent just to trigger v8110 * execution.111 */112 function devtools$$void() {113 } -
trunk/WebKit/chromium/src/js/ProfilerAgent.js
r54547 r54592 145 145 "command": "resume"}); 146 146 devtools.DebuggerAgent.sendCommand_(cmd); 147 Remote ToolsAgent.executeVoidJavaScript();147 RemoteDebuggerAgent.processDebugCommands(); 148 148 if (modules & devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_HEAP_SNAPSHOT) { 149 149 var pos = this.logPosition_; … … 163 163 "command": "pause"}); 164 164 devtools.DebuggerAgent.sendCommand_(cmd); 165 Remote ToolsAgent.executeVoidJavaScript();165 RemoteDebuggerAgent.processDebugCommands(); 166 166 }; 167 167 -
trunk/WebKit/chromium/src/js/Tests.js
r54547 r54592 614 614 view._addBreakpoint(breakpointLine); 615 615 // Force v8 execution. 616 Remote ToolsAgent.executeVoidJavaScript();616 RemoteDebuggerAgent.processDebugCommands(); 617 617 test.waitForSetBreakpointResponse_(url, breakpointLine, 618 618 function() { … … 870 870 view._addBreakpoint(breakpointLine); 871 871 // Force v8 execution. 872 Remote ToolsAgent.executeVoidJavaScript();872 RemoteDebuggerAgent.processDebugCommands(); 873 873 test.waitForSetBreakpointResponse_(url, breakpointLine, setBreakpointCallback); 874 874 });
Note: See TracChangeset
for help on using the changeset viewer.