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" |
(...skipping 26 matching lines...) Expand all Loading... |
37 friend class base::RefCountedThreadSafe<GpuWatchdogThread>; | 37 friend class base::RefCountedThreadSafe<GpuWatchdogThread>; |
38 | 38 |
39 // An object of this type intercepts the reception and completion of all tasks | 39 // An object of this type intercepts the reception and completion of all tasks |
40 // on the watched thread and checks whether the watchdog is armed. | 40 // on the watched thread and checks whether the watchdog is armed. |
41 class GpuWatchdogTaskObserver : public MessageLoop::TaskObserver { | 41 class GpuWatchdogTaskObserver : public MessageLoop::TaskObserver { |
42 public: | 42 public: |
43 explicit GpuWatchdogTaskObserver(GpuWatchdogThread* watchdog); | 43 explicit GpuWatchdogTaskObserver(GpuWatchdogThread* watchdog); |
44 virtual ~GpuWatchdogTaskObserver(); | 44 virtual ~GpuWatchdogTaskObserver(); |
45 | 45 |
46 // Implements MessageLoop::TaskObserver. | 46 // Implements MessageLoop::TaskObserver. |
47 virtual void WillProcessTask(base::TimeTicks time_posted) OVERRIDE; | 47 virtual void WillProcessTask( |
48 virtual void DidProcessTask(base::TimeTicks time_posted) OVERRIDE; | 48 const base::PendingTask& pending_task) OVERRIDE; |
| 49 virtual void DidProcessTask(const base::PendingTask& pending_task) OVERRIDE; |
49 | 50 |
50 private: | 51 private: |
51 GpuWatchdogThread* watchdog_; | 52 GpuWatchdogThread* watchdog_; |
52 }; | 53 }; |
53 | 54 |
54 virtual ~GpuWatchdogThread(); | 55 virtual ~GpuWatchdogThread(); |
55 | 56 |
56 void OnAcknowledge(); | 57 void OnAcknowledge(); |
57 void OnCheck(bool after_suspend); | 58 void OnCheck(bool after_suspend); |
58 void DeliberatelyTerminateToRecoverFromHang(); | 59 void DeliberatelyTerminateToRecoverFromHang(); |
(...skipping 17 matching lines...) Expand all Loading... |
76 base::Time suspension_timeout_; | 77 base::Time suspension_timeout_; |
77 | 78 |
78 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_; | 79 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_; |
79 | 80 |
80 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); | 81 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); |
81 }; | 82 }; |
82 | 83 |
83 } // namespace content | 84 } // namespace content |
84 | 85 |
85 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ | 86 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ |
OLD | NEW |