| Index: content/gpu/gpu_main.cc
|
| diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
|
| index c1077998dca9b3a55de2c1911b52ebcae9f1ed6f..93a140fa4c8bffeceff818f157a9e00607ace68d 100644
|
| --- a/content/gpu/gpu_main.cc
|
| +++ b/content/gpu/gpu_main.cc
|
| @@ -120,15 +120,24 @@ 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) {
|
| std::string header = str.substr(0, message_start);
|
| std::string message = str.substr(message_start);
|
| deferred_messages.Get().push(
|
| new GpuHostMsg_OnLogMessage(severity, header, message));
|
| - return false;
|
| }
|
|
|
| } // namespace anonymous
|
| @@ -166,7 +175,7 @@ int GpuMain(const MainFunctionParams& parameters) {
|
|
|
| #endif
|
|
|
| - logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
|
| + auto log_listener = base::MakeUnique<GpuMainLogMessageListener>();
|
|
|
| if (command_line.HasSwitch(switches::kSupportsDualGpus)) {
|
| std::string types = command_line.GetSwitchValueASCII(
|
| @@ -385,7 +394,7 @@ int GpuMain(const MainFunctionParams& parameters) {
|
| dead_on_arrival = true;
|
| }
|
|
|
| - logging::SetLogMessageHandler(NULL);
|
| + log_listener.reset();
|
|
|
| std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory;
|
| if (gpu::GetNativeGpuMemoryBufferType() != gfx::EMPTY_BUFFER)
|
|
|