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; |
} |