| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 void OnAddPowerObserver(); | 84 void OnAddPowerObserver(); |
| 85 | 85 |
| 86 // Implement PowerObserver. | 86 // Implement PowerObserver. |
| 87 void OnSuspend() override; | 87 void OnSuspend() override; |
| 88 void OnResume() override; | 88 void OnResume() override; |
| 89 | 89 |
| 90 #if defined(OS_WIN) | 90 #if defined(OS_WIN) |
| 91 base::ThreadTicks GetWatchedThreadTime(); | 91 base::ThreadTicks GetWatchedThreadTime(); |
| 92 #endif | 92 #endif |
| 93 | 93 |
| 94 #if defined(USE_X11) |
| 95 int GetActiveTTY() const; |
| 96 #endif |
| 97 |
| 94 base::MessageLoop* watched_message_loop_; | 98 base::MessageLoop* watched_message_loop_; |
| 95 base::TimeDelta timeout_; | 99 base::TimeDelta timeout_; |
| 96 volatile bool armed_; | 100 volatile bool armed_; |
| 97 GpuWatchdogTaskObserver task_observer_; | 101 GpuWatchdogTaskObserver task_observer_; |
| 98 | 102 |
| 99 // True if the watchdog should wait for a certain amount of CPU to be used | 103 // True if the watchdog should wait for a certain amount of CPU to be used |
| 100 // before killing the process. | 104 // before killing the process. |
| 101 bool use_thread_cpu_time_; | 105 bool use_thread_cpu_time_; |
| 102 | 106 |
| 103 // The number of consecutive acknowledgements that had a latency less than | 107 // The number of consecutive acknowledgements that had a latency less than |
| (...skipping 16 matching lines...) Expand all Loading... |
| 120 bool suspended_; | 124 bool suspended_; |
| 121 | 125 |
| 122 // The time the last OnSuspend and OnResume was called. | 126 // The time the last OnSuspend and OnResume was called. |
| 123 base::Time suspend_time_; | 127 base::Time suspend_time_; |
| 124 base::Time resume_time_; | 128 base::Time resume_time_; |
| 125 | 129 |
| 126 // This is the time the last check was sent. | 130 // This is the time the last check was sent. |
| 127 base::Time check_time_; | 131 base::Time check_time_; |
| 128 base::TimeTicks check_timeticks_; | 132 base::TimeTicks check_timeticks_; |
| 129 | 133 |
| 130 #if defined(OS_CHROMEOS) | |
| 131 FILE* tty_file_; | |
| 132 #endif | |
| 133 | |
| 134 #if defined(USE_X11) | 134 #if defined(USE_X11) |
| 135 XDisplay* display_; | 135 XDisplay* display_; |
| 136 gfx::AcceleratedWidget window_; | 136 gfx::AcceleratedWidget window_; |
| 137 XAtom atom_; | 137 XAtom atom_; |
| 138 FILE* tty_file_; |
| 139 int host_tty_; |
| 138 #endif | 140 #endif |
| 139 | 141 |
| 140 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_; | 142 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_; |
| 141 | 143 |
| 142 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); | 144 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); |
| 143 }; | 145 }; |
| 144 | 146 |
| 145 } // namespace content | 147 } // namespace content |
| 146 | 148 |
| 147 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ | 149 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ |
| OLD | NEW |