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

Side by Side Diff: content/gpu/gpu_watchdog_thread.h

Issue 11227033: Move a bunch of code in content\common (as well as a few left in renderer) to the content namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « content/gpu/gpu_process.cc ('k') | content/gpu/gpu_watchdog_thread.cc » ('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 #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.h"
13 #include "content/common/gpu/gpu_watchdog.h" 13 #include "content/common/gpu/gpu_watchdog.h"
14 14
15 namespace content {
16
15 // 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
16 // 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.
17 class GpuWatchdogThread : public base::Thread, 19 class GpuWatchdogThread : public base::Thread,
18 public GpuWatchdog, 20 public GpuWatchdog,
19 public base::RefCountedThreadSafe<GpuWatchdogThread> { 21 public base::RefCountedThreadSafe<GpuWatchdogThread> {
20 public: 22 public:
21 explicit GpuWatchdogThread(int timeout); 23 explicit GpuWatchdogThread(int timeout);
22 24
23 // Accessible on watched thread but only modified by watchdog thread. 25 // Accessible on watched thread but only modified by watchdog thread.
24 bool armed() const { return armed_; } 26 bool armed() const { return armed_; }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 base::TimeDelta arm_cpu_time_; 71 base::TimeDelta arm_cpu_time_;
70 #endif 72 #endif
71 73
72 base::Time arm_absolute_time_; 74 base::Time arm_absolute_time_;
73 75
74 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_; 76 base::WeakPtrFactory<GpuWatchdogThread> weak_factory_;
75 77
76 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread); 78 DISALLOW_COPY_AND_ASSIGN(GpuWatchdogThread);
77 }; 79 };
78 80
81 } // namespace content
82
79 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_ 83 #endif // CONTENT_GPU_GPU_WATCHDOG_THREAD_H_
OLDNEW
« no previous file with comments | « content/gpu/gpu_process.cc ('k') | content/gpu/gpu_watchdog_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698