OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
6 #include <windows.h> | 6 #include <windows.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "content/gpu/gpu_watchdog_thread.h" | 9 #include "content/gpu/gpu_watchdog_thread.h" |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
13 #include "base/process.h" | 13 #include "base/process.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "content/common/result_codes.h" | 15 #include "content/public/common/result_codes.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 const int64 kCheckPeriod = 2000; | 18 const int64 kCheckPeriod = 2000; |
19 | 19 |
20 void DoNothing() { | 20 void DoNothing() { |
21 } | 21 } |
22 } | 22 } |
23 | 23 |
24 GpuWatchdogThread::GpuWatchdogThread(int timeout) | 24 GpuWatchdogThread::GpuWatchdogThread(int timeout) |
25 : base::Thread("Watchdog"), | 25 : base::Thread("Watchdog"), |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 #endif | 233 #endif |
234 | 234 |
235 LOG(ERROR) << "The GPU process hung. Terminating after " | 235 LOG(ERROR) << "The GPU process hung. Terminating after " |
236 << timeout_ << " ms."; | 236 << timeout_ << " ms."; |
237 | 237 |
238 base::Process current_process(base::GetCurrentProcessHandle()); | 238 base::Process current_process(base::GetCurrentProcessHandle()); |
239 current_process.Terminate(content::RESULT_CODE_HUNG); | 239 current_process.Terminate(content::RESULT_CODE_HUNG); |
240 | 240 |
241 terminated = true; | 241 terminated = true; |
242 } | 242 } |
OLD | NEW |