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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/rand_util.h" | 14 #include "base/rand_util.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
17 #include "base/threading/platform_thread.h" | 17 #include "base/threading/platform_thread.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "content/child/child_process.h" | 19 #include "content/child/child_process.h" |
20 #include "content/common/gpu/gpu_config.h" | 20 #include "content/common/gpu/gpu_config.h" |
21 #include "content/common/gpu/gpu_messages.h" | 21 #include "content/common/gpu/gpu_messages.h" |
22 #include "content/common/power_monitor_client.h" | |
22 #include "content/common/sandbox_linux.h" | 23 #include "content/common/sandbox_linux.h" |
23 #include "content/gpu/gpu_child_thread.h" | 24 #include "content/gpu/gpu_child_thread.h" |
24 #include "content/gpu/gpu_process.h" | 25 #include "content/gpu/gpu_process.h" |
25 #include "content/gpu/gpu_watchdog_thread.h" | 26 #include "content/gpu/gpu_watchdog_thread.h" |
26 #include "content/public/common/content_client.h" | 27 #include "content/public/common/content_client.h" |
27 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
28 #include "content/public/common/main_function_params.h" | 29 #include "content/public/common/main_function_params.h" |
29 #include "crypto/hmac.h" | 30 #include "crypto/hmac.h" |
30 #include "gpu/config/gpu_info_collector.h" | 31 #include "gpu/config/gpu_info_collector.h" |
31 #include "ui/gl/gl_implementation.h" | 32 #include "ui/gl/gl_implementation.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 #endif | 163 #endif |
163 | 164 |
164 bool delayed_watchdog_enable = false; | 165 bool delayed_watchdog_enable = false; |
165 | 166 |
166 #if defined(OS_CHROMEOS) | 167 #if defined(OS_CHROMEOS) |
167 // Don't start watchdog immediately, to allow developers to switch to VT2 on | 168 // Don't start watchdog immediately, to allow developers to switch to VT2 on |
168 // startup. | 169 // startup. |
169 delayed_watchdog_enable = true; | 170 delayed_watchdog_enable = true; |
170 #endif | 171 #endif |
171 | 172 |
173 PowerMonitorClient power_monitor; | |
Ken Russell (switch to Gerrit)
2013/06/24 22:54:38
I don't think this function should stack-allocate
bajones
2013/06/25 18:33:34
While my gut reaction is to agree with you, this i
| |
172 scoped_refptr<GpuWatchdogThread> watchdog_thread; | 174 scoped_refptr<GpuWatchdogThread> watchdog_thread; |
173 | 175 |
174 // Start the GPU watchdog only after anything that is expected to be time | 176 // Start the GPU watchdog only after anything that is expected to be time |
175 // consuming has completed, otherwise the process is liable to be aborted. | 177 // consuming has completed, otherwise the process is liable to be aborted. |
176 if (enable_watchdog && !delayed_watchdog_enable) { | 178 if (enable_watchdog && !delayed_watchdog_enable) { |
177 watchdog_thread = new GpuWatchdogThread(kGpuTimeout); | 179 watchdog_thread = new GpuWatchdogThread(kGpuTimeout); |
178 watchdog_thread->Start(); | 180 watchdog_thread->Start(); |
179 } | 181 } |
180 | 182 |
181 gpu::GPUInfo gpu_info; | 183 gpu::GPUInfo gpu_info; |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
426 return true; | 428 return true; |
427 } | 429 } |
428 | 430 |
429 return false; | 431 return false; |
430 } | 432 } |
431 #endif // defined(OS_WIN) | 433 #endif // defined(OS_WIN) |
432 | 434 |
433 } // namespace. | 435 } // namespace. |
434 | 436 |
435 } // namespace content | 437 } // namespace content |
OLD | NEW |