diff options
author | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-27 08:24:46 +0000 |
---|---|---|
committer | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-27 08:24:46 +0000 |
commit | 2fda120d4bff29f5ae85765756e5e47c2a87a260 (patch) | |
tree | 59ff0a9b87b819a07eea4634d30904cdda8f9047 /webkit/glue/devtools/debugger_agent_manager.cc | |
parent | f600207db18c30c0179dd307f43d3fd94d2ca5fe (diff) | |
download | chromium_src-2fda120d4bff29f5ae85765756e5e47c2a87a260.zip chromium_src-2fda120d4bff29f5ae85765756e5e47c2a87a260.tar.gz chromium_src-2fda120d4bff29f5ae85765756e5e47c2a87a260.tar.bz2 |
DevTools: split console evaluation into two steps: actual evaluation and result
wrapping. When second step is executed debugger_agent_manager will autocontinue
on break. We assume that second step doesn't call user scripts.
Review URL: http://codereview.chromium.org/159395
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21635 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/devtools/debugger_agent_manager.cc')
-rw-r--r-- | webkit/glue/devtools/debugger_agent_manager.cc | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/webkit/glue/devtools/debugger_agent_manager.cc b/webkit/glue/devtools/debugger_agent_manager.cc index 12dd202..fafa308 100644 --- a/webkit/glue/devtools/debugger_agent_manager.cc +++ b/webkit/glue/devtools/debugger_agent_manager.cc @@ -29,6 +29,12 @@ bool DebuggerAgentManager::in_host_dispatch_handler_ = false; // static DebuggerAgentManager::DeferrersMap DebuggerAgentManager::page_deferrers_; +// static +bool DebuggerAgentManager::in_utility_context_ = false; + +// static +bool DebuggerAgentManager::debug_break_delayed_ = false; + namespace { class CallerIdWrapper : public v8::Debug::ClientData { @@ -157,7 +163,11 @@ void DebuggerAgentManager::DebugBreak(DebuggerAgentImpl* debugger_agent) { #if USE(V8) DCHECK(DebuggerAgentForHostId(debugger_agent->webdevtools_agent()->host_id()) == debugger_agent); - v8::Debug::DebugBreak(); + if (in_utility_context_) { + debug_break_delayed_ = true; + } else { + v8::Debug::DebugBreak(); + } #endif } @@ -201,14 +211,24 @@ void DebuggerAgentManager::OnV8DebugMessage(const v8::Debug::Message& message) { return; } - // If the context is from one of the inpected tabs or injected extension - // scripts it must have host_id in the data field. - int host_id = WebCore::V8Proxy::contextDebugId(context); - if (host_id != -1) { - DebuggerAgentImpl* agent = DebuggerAgentForHostId(host_id); - if (agent) { - agent->DebuggerOutput(out); - return; + if (in_utility_context_) { + if (message.GetEvent() == v8::Break) { + // This may happen when two tabs are being debugged in the same process. + // Suppose that first debugger is pauesed on an exception. It will run + // nested MessageLoop which may process Break request from the second + // debugger. + debug_break_delayed_ = true; + } + } else { + // If the context is from one of the inpected tabs or injected extension + // scripts it must have host_id in the data field. + int host_id = WebCore::V8Proxy::contextDebugId(context); + if (host_id != -1) { + DebuggerAgentImpl* agent = DebuggerAgentForHostId(host_id); + if (agent) { + agent->DebuggerOutput(out); + return; + } } } |