| Index: content/gpu/gpu_child_thread.cc
|
| diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
|
| index 637b4802f198153f6e398699538b81439ebdf867..cb9834179829317dab2d4d82288cb199cdb86b80 100644
|
| --- a/content/gpu/gpu_child_thread.cc
|
| +++ b/content/gpu/gpu_child_thread.cc
|
| @@ -60,19 +60,6 @@ namespace {
|
| 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) {
|
| - 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
|
| // on the IO thread. This allows the UI thread in the browser process to remain
|
| // fast at all times.
|
| @@ -142,6 +129,18 @@ ChildThreadImpl::Options GetOptions(
|
|
|
| } // namespace
|
|
|
| +void GpuProcessLogMessageListener::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);
|
| +
|
| + g_thread_safe_sender.Get()->Send(
|
| + new GpuHostMsg_OnLogMessage(severity, header, message));
|
| +}
|
| +
|
| GpuChildThread::GpuChildThread(
|
| std::unique_ptr<gpu::GpuWatchdogThread> watchdog_thread,
|
| bool dead_on_arrival,
|
| @@ -191,7 +190,8 @@ GpuChildThread::~GpuChildThread() {
|
|
|
| void GpuChildThread::Shutdown() {
|
| ChildThreadImpl::Shutdown();
|
| - logging::SetLogMessageHandler(NULL);
|
| + if (!in_browser_process_)
|
| + log_listener_.reset();
|
| }
|
|
|
| void GpuChildThread::Init(const base::Time& process_start_time) {
|
| @@ -330,7 +330,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);
|
| + log_listener_ = base::MakeUnique<GpuProcessLogMessageListener>();
|
|
|
| gpu::SyncPointManager* sync_point_manager = nullptr;
|
| // Note SyncPointManager from ContentGpuClient cannot be owned by this.
|
|
|