Chromium Code Reviews| Index: content/gpu/gpu_child_thread.cc |
| diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc |
| index 953f026a1fd8464c43b80f22ae373e4ac349daab..f650e94c698dd06c85d7f41a900431cda5b97686 100644 |
| --- a/content/gpu/gpu_child_thread.cc |
| +++ b/content/gpu/gpu_child_thread.cc |
| @@ -9,10 +9,8 @@ |
| #include "base/bind.h" |
| #include "base/callback_helpers.h" |
| -#include "base/lazy_instance.h" |
| #include "base/strings/string_number_conversions.h" |
| #include "base/threading/thread_local.h" |
| -#include "base/threading/thread_task_runner_handle.h" |
| #include "base/threading/worker_pool.h" |
| #include "build/build_config.h" |
| #include "content/child/child_process.h" |
| @@ -58,22 +56,6 @@ |
| namespace content { |
| namespace { |
| -static base::LazyInstance<scoped_refptr<ThreadSafeSender>>::DestructorAtExit |
| - 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. |
| @@ -164,7 +146,6 @@ GpuChildThread::GpuChildThread( |
| #if defined(OS_WIN) |
| target_services_ = NULL; |
| #endif |
| - g_thread_safe_sender.Get() = thread_safe_sender(); |
| } |
| GpuChildThread::GpuChildThread( |
| @@ -194,8 +175,6 @@ GpuChildThread::GpuChildThread( |
| switches::kSingleProcess) || |
| base::CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kInProcessGPU)); |
| - |
| - g_thread_safe_sender.Get() = thread_safe_sender(); |
| } |
| GpuChildThread::~GpuChildThread() { |
| @@ -203,7 +182,6 @@ GpuChildThread::~GpuChildThread() { |
| void GpuChildThread::Shutdown() { |
| ChildThreadImpl::Shutdown(); |
| - logging::SetLogMessageHandler(NULL); |
| } |
| void GpuChildThread::Init(const base::Time& process_start_time) { |
| @@ -301,7 +279,7 @@ void GpuChildThread::CreateGpuService( |
| gpu_service_->gpu_feature_info())); |
| while (!deferred_messages_.empty()) { |
| const LogMessage& log = deferred_messages_.front(); |
| - Send(new GpuHostMsg_OnLogMessage(log.severity, log.header, log.message)); |
| + gpu_host->RecordLogMessage(log.severity, log.header, log.message); |
|
piman
2017/03/20 21:20:26
Just checking, is it ok to do this before we initi
sadrul
2017/03/20 21:40:17
For now, this is OK. GpuProcessHost::DidInitialize
|
| deferred_messages_.pop(); |
| } |
| @@ -311,11 +289,6 @@ void GpuChildThread::CreateGpuService( |
| return; |
| } |
| - // 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); |
| - |
| gpu::SyncPointManager* sync_point_manager = nullptr; |
| // Note SyncPointManager from ContentGpuClient cannot be owned by this. |
| if (GetContentClient()->gpu()) |