| Index: content/gpu/gpu_main.cc
|
| diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
|
| index 2518e539bc8a55102c91f54d86345cf8403be521..59e162f0eeb5026bb50e4cb8df12d33636883b28 100644
|
| --- a/content/gpu/gpu_main.cc
|
| +++ b/content/gpu/gpu_main.cc
|
| @@ -102,16 +102,25 @@ bool StartSandboxWindows(const sandbox::SandboxInterfaceInfo*);
|
| 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& str) {
|
| +class GpuMainLogMessageListener : logging::LogMessageListener {
|
| + public:
|
| + void OnMessage(int severity,
|
| + const char* file,
|
| + int line,
|
| + size_t message_start,
|
| + const std::string& str) override;
|
| +};
|
| +
|
| +void GpuMainLogMessageListener::OnMessage(int severity,
|
| + const char* file,
|
| + int line,
|
| + size_t message_start,
|
| + const std::string& str) {
|
| GpuChildThread::LogMessage log;
|
| log.severity = severity;
|
| log.header = str.substr(0, message_start);
|
| log.message = str.substr(message_start);
|
| deferred_messages.Get().push(std::move(log));
|
| - return false;
|
| }
|
|
|
| class ContentSandboxHelper : public gpu::GpuSandboxHelper {
|
| @@ -193,7 +202,7 @@ int GpuMain(const MainFunctionParams& parameters) {
|
|
|
| #endif
|
|
|
| - logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
|
| + auto log_listener = base::MakeUnique<GpuMainLogMessageListener>();
|
|
|
| // We are experiencing what appear to be memory-stomp issues in the GPU
|
| // process. These issues seem to be impacting the message loop and listeners
|
| @@ -266,7 +275,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);
|
| + log_listener.reset();
|
| GetContentClient()->SetGpuInfo(gpu_init.gpu_info());
|
|
|
| std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory;
|
|
|