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 #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 |
(...skipping 19 matching lines...) Expand all Loading... |
30 #if defined(USE_X11) | 30 #if defined(USE_X11) |
31 const unsigned char text[20] = "check"; | 31 const unsigned char text[20] = "check"; |
32 #endif | 32 #endif |
33 } // namespace | 33 } // namespace |
34 | 34 |
35 GpuWatchdogThread::GpuWatchdogThread(int timeout) | 35 GpuWatchdogThread::GpuWatchdogThread(int timeout) |
36 : base::Thread("Watchdog"), | 36 : base::Thread("Watchdog"), |
37 watched_message_loop_(base::MessageLoop::current()), | 37 watched_message_loop_(base::MessageLoop::current()), |
38 timeout_(base::TimeDelta::FromMilliseconds(timeout)), | 38 timeout_(base::TimeDelta::FromMilliseconds(timeout)), |
39 armed_(false), | 39 armed_(false), |
| 40 task_observer_(this), |
40 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
41 watched_thread_handle_(0), | 42 watched_thread_handle_(0), |
42 arm_cpu_time_(), | 43 arm_cpu_time_(), |
43 #endif | 44 #endif |
44 task_observer_(this), | |
45 suspended_(false), | 45 suspended_(false), |
46 #if defined(USE_X11) | 46 #if defined(USE_X11) |
47 display_(NULL), | 47 display_(NULL), |
48 window_(0), | 48 window_(0), |
49 atom_(None), | 49 atom_(None), |
50 #endif | 50 #endif |
51 weak_factory_(this) { | 51 weak_factory_(this) { |
52 DCHECK(timeout >= 0); | 52 DCHECK(timeout >= 0); |
53 | 53 |
54 #if defined(OS_WIN) | 54 #if defined(OS_WIN) |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 // not increasing. The other is where either the kernel hangs and never | 393 // not increasing. The other is where either the kernel hangs and never |
394 // returns to user level or where user level code | 394 // returns to user level or where user level code |
395 // calls into kernel level repeatedly, giving up its quanta before it is | 395 // calls into kernel level repeatedly, giving up its quanta before it is |
396 // tracked, for example a loop that repeatedly Sleeps. | 396 // tracked, for example a loop that repeatedly Sleeps. |
397 return base::TimeDelta::FromMilliseconds(static_cast<int64>( | 397 return base::TimeDelta::FromMilliseconds(static_cast<int64>( |
398 (user_time64.QuadPart + kernel_time64.QuadPart) / 10000)); | 398 (user_time64.QuadPart + kernel_time64.QuadPart) / 10000)); |
399 } | 399 } |
400 #endif | 400 #endif |
401 | 401 |
402 } // namespace content | 402 } // namespace content |
OLD | NEW |