Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Unified Diff: webkit/glue/devtools/debugger_agent_manager.cc

Issue 160012: DevTools: make pause work for script evaluations (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/glue/devtools/debugger_agent_manager.cc
===================================================================
--- webkit/glue/devtools/debugger_agent_manager.cc (revision 21519)
+++ webkit/glue/devtools/debugger_agent_manager.cc (working copy)
@@ -29,6 +29,12 @@
// 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 @@
#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,15 +211,25 @@
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;
+ }
+ }
}
if (!message.WillStartRunning()) {

Powered by Google App Engine
This is Rietveld 408576698