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

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: Add braces 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..9f482a90083e60f3912a64f7a6865cd6ea8e7cba 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,18 @@ 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(
- new GpuHostMsg_OnLogMessage(severity, header, message));
+
+ // 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()) {
+ ChildProcess::current()->main_thread()->sync_message_filter()->Send(
+ new GpuHostMsg_OnLogMessage(severity, header, message));
+ } else {
+ ChildThread::current()->Send(new GpuHostMsg_OnLogMessage(severity, header,
+ message));
+ }
+
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