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 #ifndef CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ | 5 #ifndef CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ |
6 #define CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ | 6 #define CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Implements MessageLoop::TaskObserver. | 45 // Implements MessageLoop::TaskObserver. |
46 virtual void WillProcessTask(base::TimeTicks time_posted) OVERRIDE; | 46 virtual void WillProcessTask(base::TimeTicks time_posted) OVERRIDE; |
47 virtual void DidProcessTask(base::TimeTicks time_posted) OVERRIDE; | 47 virtual void DidProcessTask(base::TimeTicks time_posted) OVERRIDE; |
48 | 48 |
49 private: | 49 private: |
50 GpuWatchdogThread* watchdog_; | 50 GpuWatchdogThread* watchdog_; |
51 }; | 51 }; |
52 | 52 |
53 void OnAcknowledge(); | 53 void OnAcknowledge(); |
54 void OnCheck(); | 54 void OnCheck(); |
55 void DeliberatelyCrashingToRecoverFromHang(); | 55 void DeliberatelyTerminateToRecoverFromHang(); |
56 void Disable(); | 56 void Disable(); |
57 | 57 |
58 int64 GetWatchedThreadTime(); | 58 int64 GetWatchedThreadTime(); |
59 | 59 |
60 MessageLoop* watched_message_loop_; | 60 MessageLoop* watched_message_loop_; |
61 int timeout_; | 61 int timeout_; |
62 volatile bool armed_; | 62 volatile bool armed_; |
63 GpuWatchdogTaskObserver task_observer_; | 63 GpuWatchdogTaskObserver task_observer_; |
64 | 64 |
65 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
66 void* watched_thread_handle_; | 66 void* watched_thread_handle_; |
67 int64 arm_cpu_time_; | 67 int64 arm_cpu_time_; |
68 #endif | 68 #endif |
69 | 69 |
70 base::Time arm_absolute_time_; | 70 base::Time arm_absolute_time_; |
71 | 71 |
72 typedef ScopedRunnableMethodFactory<GpuWatchdogThread> MethodFactory; | 72 typedef ScopedRunnableMethodFactory<GpuWatchdogThread> MethodFactory; |
73 scoped_ptr<MethodFactory> method_factory_; | 73 scoped_ptr<MethodFactory> method_factory_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); | 75 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); |
76 }; | 76 }; |
77 | 77 |
78 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ | 78 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ |
OLD | NEW |