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/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/threading/thread.h" | 11 #include "base/threading/thread.h" |
12 #include "base/time.h" | 12 #include "base/time/time.h" |
13 #include "content/common/gpu/gpu_watchdog.h" | 13 #include "content/common/gpu/gpu_watchdog.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 // A thread that intermitently sends tasks to a group of watched message loops | 17 // A thread that intermitently sends tasks to a group of watched message loops |
18 // and deliberately crashes if one of them does not respond after a timeout. | 18 // and deliberately crashes if one of them does not respond after a timeout. |
19 class GpuWatchdogThread : public base::Thread, | 19 class GpuWatchdogThread : public base::Thread, |
20 public GpuWatchdog, | 20 public GpuWatchdog, |
21 public base::RefCountedThreadSafe<GpuWatchdogThread> { | 21 public base::RefCountedThreadSafe<GpuWatchdogThread> { |
22 public: | 22 public: |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 base::Time suspension_timeout_; | 77 base::Time suspension_timeout_; |
78 | 78 |
79 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_; | 79 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); | 81 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); |
82 }; | 82 }; |
83 | 83 |
84 } // namespace content | 84 } // namespace content |
85 | 85 |
86 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ | 86 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ |
OLD | NEW |