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

Side by Side Diff: gpu/ipc/service/gpu_watchdog_thread.cc

Issue 2289553002: gpu: Introduce GpuInit. (Closed)
Patch Set: . Created 4 years, 3 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 | « gpu/ipc/service/gpu_init_delegate.h ('k') | services/ui/gpu/BUILD.gn » ('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 #include "gpu/ipc/service/gpu_watchdog_thread.h" 5 #include "gpu/ipc/service/gpu_watchdog_thread.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 if (power_monitor) 145 if (power_monitor)
146 power_monitor->RemoveObserver(this); 146 power_monitor->RemoveObserver(this);
147 147
148 #if defined(USE_X11) 148 #if defined(USE_X11)
149 if (tty_file_) 149 if (tty_file_)
150 fclose(tty_file_); 150 fclose(tty_file_);
151 XDestroyWindow(display_, window_); 151 XDestroyWindow(display_, window_);
152 XCloseDisplay(display_); 152 XCloseDisplay(display_);
153 #endif 153 #endif
154 154
155 watched_message_loop_->RemoveTaskObserver(&task_observer_); 155 if (base::MessageLoop::current())
156 watched_message_loop_->RemoveTaskObserver(&task_observer_);
156 } 157 }
157 158
158 void GpuWatchdogThread::OnAcknowledge() { 159 void GpuWatchdogThread::OnAcknowledge() {
159 CHECK(base::PlatformThread::CurrentId() == GetThreadId()); 160 CHECK(base::PlatformThread::CurrentId() == GetThreadId());
160 161
161 // The check has already been acknowledged and another has already been 162 // The check has already been acknowledged and another has already been
162 // scheduled by a previous call to OnAcknowledge. It is normal for a 163 // scheduled by a previous call to OnAcknowledge. It is normal for a
163 // watched thread to see armed_ being true multiple times before 164 // watched thread to see armed_ being true multiple times before
164 // the OnAcknowledge task is run on the watchdog thread. 165 // the OnAcknowledge task is run on the watchdog thread.
165 if (!armed_) 166 if (!armed_)
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 int tty_number; 476 int tty_number;
476 size_t num_res = sscanf(tty_string, "tty%d\n", &tty_number); 477 size_t num_res = sscanf(tty_string, "tty%d\n", &tty_number);
477 if (num_res == 1) 478 if (num_res == 1)
478 return tty_number; 479 return tty_number;
479 } 480 }
480 return -1; 481 return -1;
481 } 482 }
482 #endif 483 #endif
483 484
484 } // namespace gpu 485 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_init_delegate.h ('k') | services/ui/gpu/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698