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

Unified Diff: content/gpu/gpu_watchdog_thread.cc

Issue 6463013: Add support for base::Closure in the MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: rebased Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/gpu/gpu_watchdog_thread.cc
diff --git a/content/gpu/gpu_watchdog_thread.cc b/content/gpu/gpu_watchdog_thread.cc
index a7d723c52e914b6a4c94544875039108ebf274b4..e729ea6116c078f4f378c0a995c2ec8412da13e4 100644
--- a/content/gpu/gpu_watchdog_thread.cc
+++ b/content/gpu/gpu_watchdog_thread.cc
@@ -27,7 +27,7 @@ GpuWatchdogThread::GpuWatchdogThread(int timeout)
watched_thread_handle_(0),
arm_cpu_time_(0),
#endif
- ALLOW_THIS_IN_INITIALIZER_LIST(task_observer_(this)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(closure_observer_(this)) {
DCHECK(timeout >= 0);
#if defined(OS_WIN)
@@ -44,7 +44,7 @@ GpuWatchdogThread::GpuWatchdogThread(int timeout)
DCHECK(result);
#endif
- watched_message_loop_->AddTaskObserver(&task_observer_);
+ watched_message_loop_->AddClosureObserver(&closure_observer_);
}
GpuWatchdogThread::~GpuWatchdogThread() {
@@ -56,7 +56,7 @@ GpuWatchdogThread::~GpuWatchdogThread() {
CloseHandle(watched_thread_handle_);
#endif
- watched_message_loop_->RemoveTaskObserver(&task_observer_);
+ watched_message_loop_->RemoveClosureObserver(&closure_observer_);
}
void GpuWatchdogThread::PostAcknowledge() {
@@ -81,28 +81,25 @@ void GpuWatchdogThread::CleanUp() {
method_factory_.reset();
}
-GpuWatchdogThread::GpuWatchdogTaskObserver::GpuWatchdogTaskObserver(
+GpuWatchdogThread::GpuWatchdogClosureObserver::GpuWatchdogClosureObserver(
GpuWatchdogThread* watchdog)
- : watchdog_(watchdog) {
+ : watchdog_(watchdog) {
}
-GpuWatchdogThread::GpuWatchdogTaskObserver::~GpuWatchdogTaskObserver() {
+GpuWatchdogThread::GpuWatchdogClosureObserver::~GpuWatchdogClosureObserver() {
}
-void GpuWatchdogThread::GpuWatchdogTaskObserver::WillProcessTask(
- const Task* task)
-{
+void GpuWatchdogThread::GpuWatchdogClosureObserver::WillProcessClosure(
+ base::TimeTicks time_posted) {
CheckArmed();
}
-void GpuWatchdogThread::GpuWatchdogTaskObserver::DidProcessTask(
- const Task* task)
-{
+void GpuWatchdogThread::GpuWatchdogClosureObserver::DidProcessClosure(
+ base::TimeTicks time_posted) {
CheckArmed();
}
-void GpuWatchdogThread::GpuWatchdogTaskObserver::CheckArmed()
-{
+void GpuWatchdogThread::GpuWatchdogClosureObserver::CheckArmed() {
// Acknowledge the watchdog if it has armed itself. The watchdog will not
// change its armed state until it is acknowledged.
if (watchdog_->armed()) {
@@ -167,8 +164,8 @@ void GpuWatchdogThread::OnCheck() {
return;
// Must set armed before posting the task. This task might be the only task
- // that will activate the TaskObserver on the watched thread and it must not
- // miss the false -> true transition.
+ // that will activate the ClosureObserver on the watched thread and it must
+ // not miss the false -> true transition.
armed_ = true;
#if defined(OS_WIN)
@@ -178,8 +175,8 @@ void GpuWatchdogThread::OnCheck() {
arm_absolute_time_ = base::Time::Now();
// Post a task to the monitored thread that does nothing but wake up the
- // TaskObserver. Any other tasks that are pending on the watched thread will
- // also wake up the observer. This simply ensures there is at least one.
+ // ClosureObserver. Any other tasks that are pending on the watched thread
+ // will also wake up the observer. This simply ensures there is at least one.
watched_message_loop_->PostTask(
FROM_HERE,
NewRunnableFunction(DoNothing));

Powered by Google App Engine
This is Rietveld 408576698