| 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 GPU_IPC_SERVICE_GPU_WATCHDOG_THREAD_H_ | 5 #ifndef GPU_IPC_SERVICE_GPU_WATCHDOG_THREAD_H_ |
| 6 #define GPU_IPC_SERVICE_GPU_WATCHDOG_THREAD_H_ | 6 #define GPU_IPC_SERVICE_GPU_WATCHDOG_THREAD_H_ |
| 7 | 7 |
| 8 #include "base/atomicops.h" | 8 #include "base/atomicops.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/power_monitor/power_observer.h" | 13 #include "base/power_monitor/power_observer.h" |
| 14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "gpu/command_buffer/service/progress_reporter.h" | 17 #include "gpu/command_buffer/service/progress_reporter.h" |
| 18 #include "gpu/gpu_export.h" | 18 #include "gpu/gpu_export.h" |
| 19 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" |
| 20 | 20 |
| 21 #if defined(USE_X11) | 21 #if defined(USE_X11) |
| 22 extern "C" { | |
| 23 #include <X11/Xlib.h> | |
| 24 #include <X11/Xatom.h> | |
| 25 } | |
| 26 #include <sys/poll.h> | 22 #include <sys/poll.h> |
| 27 #include "ui/base/x/x11_util.h" // nogncheck | 23 #include "ui/base/x/x11_util.h" // nogncheck |
| 28 #include "ui/gfx/x/x11_types.h" // nogncheck | 24 #include "ui/gfx/x/x11_types.h" // nogncheck |
| 29 #endif // defined(USE_X11) | 25 #endif // defined(USE_X11) |
| 30 | 26 |
| 31 namespace gpu { | 27 namespace gpu { |
| 32 | 28 |
| 33 // A thread that intermitently sends tasks to a group of watched message loops | 29 // A thread that intermitently sends tasks to a group of watched message loops |
| 34 // and deliberately crashes if one of them does not respond after a timeout. | 30 // and deliberately crashes if one of them does not respond after a timeout. |
| 35 class GPU_EXPORT GpuWatchdogThread : public base::Thread, | 31 class GPU_EXPORT GpuWatchdogThread : public base::Thread, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 #endif | 141 #endif |
| 146 | 142 |
| 147 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_; | 143 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_; |
| 148 | 144 |
| 149 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); | 145 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); |
| 150 }; | 146 }; |
| 151 | 147 |
| 152 } // namespace gpu | 148 } // namespace gpu |
| 153 | 149 |
| 154 #endif // GPU_IPC_SERVICE_GPU_WATCHDOG_THREAD_H_ | 150 #endif // GPU_IPC_SERVICE_GPU_WATCHDOG_THREAD_H_ |
| OLD | NEW |