Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: content/gpu/gpu_watchdog_thread.h

Issue 1991353002: Don't restart the GPU process when switching to another TTY (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't exit the GPU process if on a non-host TTY Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/gpu/gpu_watchdog_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | content/gpu/gpu_watchdog_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698