Chromium Code Reviews| Index: gpu/ipc/service/gpu_watchdog_thread.h |
| diff --git a/content/gpu/gpu_watchdog_thread.h b/gpu/ipc/service/gpu_watchdog_thread.h |
| similarity index 86% |
| rename from content/gpu/gpu_watchdog_thread.h |
| rename to gpu/ipc/service/gpu_watchdog_thread.h |
| index 68d3cd8cb8d7c9b6574e69fa21f21d418b311b5a..be411fcf820504aa40f45c5efb209cc012cdcf87 100644 |
| --- a/content/gpu/gpu_watchdog_thread.h |
| +++ b/gpu/ipc/service/gpu_watchdog_thread.h |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ |
| -#define CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ |
| +#ifndef GPU_IPC_SERVICE_GPU_WATCHDOG_THREAD_H_ |
| +#define GPU_IPC_SERVICE_GPU_WATCHDOG_THREAD_H_ |
| #include "base/macros.h" |
| #include "base/memory/ref_counted.h" |
| @@ -13,6 +13,7 @@ |
| #include "base/threading/thread.h" |
| #include "base/time/time.h" |
| #include "build/build_config.h" |
| +#include "gpu/gpu_export.h" |
| #include "gpu/ipc/service/gpu_watchdog.h" |
| #include "ui/gfx/native_widget_types.h" |
| @@ -24,24 +25,25 @@ extern "C" { |
| #include <sys/poll.h> |
| #include "ui/base/x/x11_util.h" // nogncheck |
| #include "ui/gfx/x/x11_types.h" // nogncheck |
| -#endif |
| +#endif // defined(USE_X11) |
| -namespace content { |
| +namespace gpu { |
| // A thread that intermitently sends tasks to a group of watched message loops |
| // and deliberately crashes if one of them does not respond after a timeout. |
| -class GpuWatchdogThread : public base::Thread, |
| - public gpu::GpuWatchdog, |
| - public base::PowerObserver, |
| - public base::RefCountedThreadSafe<GpuWatchdogThread> { |
| +class GPU_EXPORT GpuWatchdogThread |
| + : public base::Thread, |
| + NON_EXPORTED_BASE(public GpuWatchdog), |
|
sadrul
2016/08/28 13:01:58
There's no other subclass of GpuWatchdog, and now
Fady Samuel
2016/08/29 16:41:37
Since this isn't used in tests, this seems like a
sadrul
2016/08/29 20:00:32
Done.
|
| + public base::PowerObserver, |
| + public base::RefCountedThreadSafe<GpuWatchdogThread> { |
| public: |
| - explicit GpuWatchdogThread(int timeout); |
| + static scoped_refptr<GpuWatchdogThread> Create(); |
| // Accessible on watched thread but only modified by watchdog thread. |
| bool armed() const { return armed_; } |
| void PostAcknowledge(); |
| - // Implement gpu::GpuWatchdog. |
| + // Implement GpuWatchdog. |
| void CheckArmed() override; |
| // Must be called after a PowerMonitor has been created. Can be called from |
| @@ -70,6 +72,7 @@ class GpuWatchdogThread : public base::Thread, |
| GpuWatchdogThread* watchdog_; |
| }; |
| + GpuWatchdogThread(); |
| ~GpuWatchdogThread() override; |
| void OnAcknowledge(); |
| @@ -144,6 +147,6 @@ class GpuWatchdogThread : public base::Thread, |
| DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); |
| }; |
| -} // namespace content |
| +} // namespace gpu |
| -#endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ |
| +#endif // GPU_IPC_SERVICE_GPU_WATCHDOG_THREAD_H_ |