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 | |
95 base::MessageLoop* watched_message_loop_; | 91 base::MessageLoop* watched_message_loop_; |
96 base::TimeDelta timeout_; | 92 base::TimeDelta timeout_; |
97 volatile bool armed_; | 93 volatile bool armed_; |
98 GpuWatchdogTaskObserver task_observer_; | 94 GpuWatchdogTaskObserver task_observer_; |
99 | 95 |
100 #if defined(OS_WIN) | |
101 void* watched_thread_handle_; | |
102 base::TimeDelta arm_cpu_time_; | |
103 #endif | |
104 | |
105 // Time after which it's assumed that the computer has been suspended since | 96 // Time after which it's assumed that the computer has been suspended since |
106 // the task was posted. | 97 // the task was posted. |
107 base::Time suspension_timeout_; | 98 base::Time suspension_timeout_; |
108 | 99 |
109 bool suspended_; | 100 bool suspended_; |
110 | 101 |
111 #if defined(OS_CHROMEOS) | 102 #if defined(OS_CHROMEOS) |
112 FILE* tty_file_; | 103 FILE* tty_file_; |
113 #endif | 104 #endif |
114 | 105 |
115 #if defined(USE_X11) | 106 #if defined(USE_X11) |
116 XDisplay* display_; | 107 XDisplay* display_; |
117 gfx::AcceleratedWidget window_; | 108 gfx::AcceleratedWidget window_; |
118 XAtom atom_; | 109 XAtom atom_; |
119 #endif | 110 #endif |
120 | 111 |
121 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_; | 112 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_; |
122 | 113 |
123 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); | 114 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); |
124 }; | 115 }; |
125 | 116 |
126 } // namespace content | 117 } // namespace content |
127 | 118 |
128 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ | 119 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ |
OLD | NEW |