Index: content/gpu/gpu_child_thread.cc |
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc |
index af207abecc83bbbb6b4f90ae422748405757120e..13d1e2c658eaff42f75b926a321b70e7e4ff072b 100644 |
--- a/content/gpu/gpu_child_thread.cc |
+++ b/content/gpu/gpu_child_thread.cc |
@@ -61,17 +61,15 @@ base::LazyInstance<base::ThreadLocalPointer<GpuChildThread>> g_lazy_tls = |
static base::LazyInstance<scoped_refptr<ThreadSafeSender> > |
g_thread_safe_sender = LAZY_INSTANCE_INITIALIZER; |
-bool GpuProcessLogMessageHandler(int severity, |
- const char* file, int line, |
- size_t message_start, |
- const std::string& str) { |
+void GpuProcessLogMessageListener(int severity, |
+ const char* file, int line, |
+ size_t message_start, |
+ const std::string& str) { |
std::string header = str.substr(0, message_start); |
std::string message = str.substr(message_start); |
g_thread_safe_sender.Get()->Send( |
new GpuHostMsg_OnLogMessage(severity, header, message)); |
- |
- return false; |
} |
// Message filter used to to handle GpuMsg_CreateGpuMemoryBuffer messages |
@@ -205,7 +203,8 @@ GpuChildThread::~GpuChildThread() { |
void GpuChildThread::Shutdown() { |
ChildThreadImpl::Shutdown(); |
- logging::SetLogMessageHandler(NULL); |
+ if (!in_browser_process_) |
+ logging::RemoveLogMessageListener(GpuProcessLogMessageListener); |
} |
void GpuChildThread::Init(const base::Time& process_start_time) { |
@@ -395,7 +394,7 @@ void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) { |
// We don't need to pipe log messages if we are running the GPU thread in |
// the browser process. |
if (!in_browser_process_) |
- logging::SetLogMessageHandler(GpuProcessLogMessageHandler); |
+ logging::AddLogMessageListener(GpuProcessLogMessageListener); |
gpu::SyncPointManager* sync_point_manager = nullptr; |
// Note SyncPointManager from ContentGpuClient cannot be owned by this. |