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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); | 143 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); |
144 | 144 |
145 // Record initialization only after collecting the GPU info because that can | 145 // Record initialization only after collecting the GPU info because that can |
146 // take a significant amount of time. | 146 // take a significant amount of time. |
147 gpu_info_.initialization_time = base::Time::Now() - process_start_time_; | 147 gpu_info_.initialization_time = base::Time::Now() - process_start_time_; |
148 | 148 |
149 // Defer creation of the render thread. This is to prevent it from handling | 149 // Defer creation of the render thread. This is to prevent it from handling |
150 // IPC messages before the sandbox has been enabled and all other necessary | 150 // IPC messages before the sandbox has been enabled and all other necessary |
151 // initialization has succeeded. | 151 // initialization has succeeded. |
152 gpu_channel_manager_.reset( | 152 gpu_channel_manager_.reset( |
153 new GpuChannelManager(this, | 153 new GpuChannelManager(GetRouter(), |
154 watchdog_thread_.get(), | 154 watchdog_thread_.get(), |
155 ChildProcess::current()->io_message_loop_proxy(), | 155 ChildProcess::current()->io_message_loop_proxy(), |
156 ChildProcess::current()->GetShutDownEvent())); | 156 ChildProcess::current()->GetShutDownEvent())); |
157 | 157 |
158 // Ensure the browser process receives the GPU info before a reply to any | 158 // Ensure the browser process receives the GPU info before a reply to any |
159 // subsequent IPC it might send. | 159 // subsequent IPC it might send. |
160 if (!in_browser_process_) | 160 if (!in_browser_process_) |
161 Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_)); | 161 Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_)); |
162 } | 162 } |
163 | 163 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 // the future posting of tasks to the message loop. | 234 // the future posting of tasks to the message loop. |
235 if (watchdog_thread_->message_loop()) | 235 if (watchdog_thread_->message_loop()) |
236 watchdog_thread_->PostAcknowledge(); | 236 watchdog_thread_->PostAcknowledge(); |
237 // Prevent rearming. | 237 // Prevent rearming. |
238 watchdog_thread_->Stop(); | 238 watchdog_thread_->Stop(); |
239 } | 239 } |
240 } | 240 } |
241 | 241 |
242 } // namespace content | 242 } // namespace content |
243 | 243 |
OLD | NEW |