Index: content/gpu/gpu_main.cc |
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc |
index 51c2868899c077360575fbf89cab0518e99bc7a0..0394165c9698e85de5da787f491a9777eac8996e 100644 |
--- a/content/gpu/gpu_main.cc |
+++ b/content/gpu/gpu_main.cc |
@@ -102,13 +102,12 @@ base::LazyInstance<GpuChildThread::DeferredMessages> deferred_messages = |
LAZY_INSTANCE_INITIALIZER; |
bool GpuProcessLogMessageHandler(int severity, |
- const char* file, int line, |
- size_t message_start, |
+ const std::string& file, |
+ int line, |
const std::string& str) { |
- std::string header = str.substr(0, message_start); |
- std::string message = str.substr(message_start); |
+ std::string header = file + "(" + std::to_string(line) + "):"; |
deferred_messages.Get().push( |
- new GpuHostMsg_OnLogMessage(severity, header, message)); |
+ new GpuHostMsg_OnLogMessage(severity, header, str)); |
return false; |
} |
@@ -191,7 +190,7 @@ int GpuMain(const MainFunctionParams& parameters) { |
#endif |
- logging::SetLogMessageHandler(GpuProcessLogMessageHandler); |
+ logging::AddLogMessageHandler(GpuProcessLogMessageHandler); |
#if defined(OS_WIN) |
// OK to use default non-UI message loop because all GPU windows run on |
@@ -249,7 +248,7 @@ int GpuMain(const MainFunctionParams& parameters) { |
const bool init_success = gpu_init.InitializeAndStartSandbox(command_line); |
const bool dead_on_arrival = !init_success; |
- logging::SetLogMessageHandler(NULL); |
+ logging::RemoveLogMessageHandler(GpuProcessLogMessageHandler); |
GetContentClient()->SetGpuInfo(gpu_init.gpu_info()); |
std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory; |