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

Unified Diff: chrome/renderer/debug_message_handler.cc

Issue 8735: Changed the call to attach the debugger to V8 to run in the renderer thread. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 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: 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) {
« chrome/renderer/debug_message_handler.h ('K') | « chrome/renderer/debug_message_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698