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

Unified Diff: content/gpu/gpu_child_thread.cc

Issue 9812022: Fix sending log messages from GPU child threads (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_child_thread.cc
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index 9d5ac554aba5b647c3a38a1a9d0cbc8b3ad12046..d660de3084e25992bddb948b6b5c200eb0c37b6d 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -17,6 +17,7 @@
#include "content/gpu/gpu_info_collector.h"
#include "content/gpu/gpu_watchdog_thread.h"
#include "ipc/ipc_channel_handle.h"
+#include "ipc/ipc_sync_message_filter.h"
#include "ui/gfx/gl/gl_implementation.h"
const int kGpuTimeout = 10000;
@@ -29,8 +30,17 @@ bool GpuProcessLogMessageHandler(int severity,
const std::string& str) {
std::string header = str.substr(0, message_start);
std::string message = str.substr(message_start);
- ChildThread::current()->Send(
+
+ // If we are not on main thread in child process, send through
+ // the sync_message_filter; otherwise send directly.
+ if (MessageLoop::current() !=
+ ChildProcess::current()->main_thread()->message_loop())
apatrick_chromium 2012/03/21 22:38:17 nit: we'd typically give this if-else braces since
+ ChildProcess::current()->main_thread()->sync_message_filter()->Send(
+ new GpuHostMsg_OnLogMessage(severity, header, message));
apatrick_chromium 2012/03/21 22:38:17 nit: indent out by two spaces on this line.
+ else
+ ChildThread::current()->Send(
new GpuHostMsg_OnLogMessage(severity, header, message));
apatrick_chromium 2012/03/21 22:38:17 ... and this one.
+
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698