Chromium Code Reviews| Index: chrome/renderer/debug_message_handler.cc |
| =================================================================== |
| --- chrome/renderer/debug_message_handler.cc (revision 4124) |
| +++ chrome/renderer/debug_message_handler.cc (working copy) |
| @@ -26,6 +26,12 @@ |
| } |
| } |
| +void DebugMessageHandler::Attach() { |
| + DCHECK(MessageLoop::current() == view_loop_); |
| + debugger_->Attach(); |
| +} |
| + |
| + |
| /////////////////////////////////////////////// |
| // all methods below called from the IO thread |
| @@ -34,7 +40,11 @@ |
| } |
| void DebugMessageHandler::OnBreak(bool force) { |
| + // Set the debug break flag in the V8 enging. |
|
Erik does not do reviews
2008/11/05 17:00:13
typo -> engine
|
| debugger_->Break(force); |
| + |
| + // If a forced break has been requested make sure that it will occour by |
|
Erik does not do reviews
2008/11/05 17:00:13
typo: "occur"
|
| + // running some JavaScript in the renderer. |
| if (force && view_loop_) { |
| view_loop_->PostTask(FROM_HERE, NewRunnableMethod( |
| this, &DebugMessageHandler::EvaluateScriptUrl, |
| @@ -46,7 +56,13 @@ |
| if (!debugger_) { |
| debugger_ = new Debugger(this); |
| } |
| - debugger_->Attach(); |
| + |
| + // Run the actual debugger attach in the renderer as it uses V8 methods which |
| + // most run in the V8 thread. |
|
Erik does not do reviews
2008/11/05 17:00:13
most -> must
|
| + if (view_loop_) { |
| + view_loop_->PostTask(FROM_HERE, NewRunnableMethod( |
| + this, &DebugMessageHandler::Attach)); |
| + } |
| } |
| void DebugMessageHandler::OnCommand(const std::wstring& cmd) { |