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 #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/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 void SetupXChangeProp(); | 81 void SetupXChangeProp(); |
82 bool MatchXEventAtom(XEvent* event); | 82 bool MatchXEventAtom(XEvent* event); |
83 #endif | 83 #endif |
84 | 84 |
85 void OnAddPowerObserver(); | 85 void OnAddPowerObserver(); |
86 | 86 |
87 // Implement PowerObserver. | 87 // Implement PowerObserver. |
88 void OnSuspend() override; | 88 void OnSuspend() override; |
89 void OnResume() override; | 89 void OnResume() override; |
90 | 90 |
| 91 #if defined(OS_WIN) |
| 92 base::TimeDelta GetWatchedThreadTime(); |
| 93 #endif |
| 94 |
91 base::MessageLoop* watched_message_loop_; | 95 base::MessageLoop* watched_message_loop_; |
92 base::TimeDelta timeout_; | 96 base::TimeDelta timeout_; |
93 volatile bool armed_; | 97 volatile bool armed_; |
94 GpuWatchdogTaskObserver task_observer_; | 98 GpuWatchdogTaskObserver task_observer_; |
95 | 99 |
| 100 #if defined(OS_WIN) |
| 101 void* watched_thread_handle_; |
| 102 base::TimeDelta arm_cpu_time_; |
| 103 #endif |
| 104 |
96 // Time after which it's assumed that the computer has been suspended since | 105 // Time after which it's assumed that the computer has been suspended since |
97 // the task was posted. | 106 // the task was posted. |
98 base::Time suspension_timeout_; | 107 base::Time suspension_timeout_; |
99 | 108 |
100 bool suspended_; | 109 bool suspended_; |
101 | 110 |
102 #if defined(OS_CHROMEOS) | 111 #if defined(OS_CHROMEOS) |
103 FILE* tty_file_; | 112 FILE* tty_file_; |
104 #endif | 113 #endif |
105 | 114 |
106 #if defined(USE_X11) | 115 #if defined(USE_X11) |
107 XDisplay* display_; | 116 XDisplay* display_; |
108 gfx::AcceleratedWidget window_; | 117 gfx::AcceleratedWidget window_; |
109 XAtom atom_; | 118 XAtom atom_; |
110 #endif | 119 #endif |
111 | 120 |
112 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_; | 121 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_; |
113 | 122 |
114 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); | 123 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); |
115 }; | 124 }; |
116 | 125 |
117 } // namespace content | 126 } // namespace content |
118 | 127 |
119 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ | 128 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ |
OLD | NEW |