| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/gpu/gpu_child_thread.h" | 5 #include "content/gpu/gpu_child_thread.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/threading/worker_pool.h" | 9 #include "base/threading/worker_pool.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 if (!in_browser_process_) | 156 if (!in_browser_process_) |
| 157 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); | 157 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); |
| 158 | 158 |
| 159 // Defer creation of the render thread. This is to prevent it from handling | 159 // Defer creation of the render thread. This is to prevent it from handling |
| 160 // IPC messages before the sandbox has been enabled and all other necessary | 160 // IPC messages before the sandbox has been enabled and all other necessary |
| 161 // initialization has succeeded. | 161 // initialization has succeeded. |
| 162 gpu_channel_manager_.reset( | 162 gpu_channel_manager_.reset( |
| 163 new GpuChannelManager(GetRouter(), | 163 new GpuChannelManager(GetRouter(), |
| 164 watchdog_thread_.get(), | 164 watchdog_thread_.get(), |
| 165 ChildProcess::current()->io_message_loop_proxy(), | 165 ChildProcess::current()->io_message_loop_proxy(), |
| 166 ChildProcess::current()->GetShutDownEvent())); | 166 ChildProcess::current()->GetShutDownEvent(), |
| 167 channel())); |
| 167 | 168 |
| 168 #if defined(USE_OZONE) | 169 #if defined(USE_OZONE) |
| 169 ui::OzonePlatform::GetInstance() | 170 ui::OzonePlatform::GetInstance() |
| 170 ->GetGpuPlatformSupport() | 171 ->GetGpuPlatformSupport() |
| 171 ->OnChannelEstablished(this); | 172 ->OnChannelEstablished(this); |
| 172 #endif | 173 #endif |
| 173 } | 174 } |
| 174 | 175 |
| 175 void GpuChildThread::StopWatchdog() { | 176 void GpuChildThread::StopWatchdog() { |
| 176 if (watchdog_thread_.get()) { | 177 if (watchdog_thread_.get()) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // the future posting of tasks to the message loop. | 257 // the future posting of tasks to the message loop. |
| 257 if (watchdog_thread_->message_loop()) | 258 if (watchdog_thread_->message_loop()) |
| 258 watchdog_thread_->PostAcknowledge(); | 259 watchdog_thread_->PostAcknowledge(); |
| 259 // Prevent rearming. | 260 // Prevent rearming. |
| 260 watchdog_thread_->Stop(); | 261 watchdog_thread_->Stop(); |
| 261 } | 262 } |
| 262 } | 263 } |
| 263 | 264 |
| 264 } // namespace content | 265 } // namespace content |
| 265 | 266 |
| OLD | NEW |