Chromium Code Reviews| Index: chrome/gpu/gpu_watchdog_thread.cc |
| =================================================================== |
| --- chrome/gpu/gpu_watchdog_thread.cc (revision 67572) |
| +++ chrome/gpu/gpu_watchdog_thread.cc (working copy) |
| @@ -59,9 +59,6 @@ |
| // The method factory must be destroyed on the watchdog thread. |
| method_factory_->RevokeAll(); |
| method_factory_.reset(); |
| - |
| - // Prevent any more delayed tasks from being posted. |
| - watched_message_loop_ = NULL; |
|
apatrick_chromium
2010/11/29 22:00:14
I don't think this was actually needed.
|
| } |
| GpuWatchdogThread::GpuWatchdogTaskObserver::GpuWatchdogTaskObserver( |
| @@ -106,35 +103,31 @@ |
| armed_ = false; |
| // The monitored thread has responded. Post a task to check it again. |
| - if (watched_message_loop_) { |
| - message_loop()->PostDelayedTask( |
| - FROM_HERE, |
| - method_factory_->NewRunnableMethod(&GpuWatchdogThread::OnCheck), |
| - kCheckPeriod); |
| - } |
| + message_loop()->PostDelayedTask( |
| + FROM_HERE, |
| + method_factory_->NewRunnableMethod(&GpuWatchdogThread::OnCheck), |
| + kCheckPeriod); |
| } |
| void GpuWatchdogThread::OnCheck() { |
| - if (watched_message_loop_) { |
| - // 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. |
| - armed_ = true; |
| + // 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. |
| + armed_ = true; |
| - // 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. |
| - watched_message_loop_->PostTask( |
| - FROM_HERE, |
| - NewRunnableFunction(DoNothing)); |
| + // 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. |
| + watched_message_loop_->PostTask( |
| + FROM_HERE, |
| + NewRunnableFunction(DoNothing)); |
| - // Post a task to the watchdog thread to exit if the monitored thread does |
| - // not respond in time. |
| - message_loop()->PostDelayedTask( |
| - FROM_HERE, |
| - method_factory_->NewRunnableMethod(&GpuWatchdogThread::OnExit), |
| - timeout_); |
| - } |
| + // Post a task to the watchdog thread to exit if the monitored thread does |
| + // not respond in time. |
| + message_loop()->PostDelayedTask( |
| + FROM_HERE, |
| + method_factory_->NewRunnableMethod(&GpuWatchdogThread::OnExit), |
| + timeout_); |
| } |
| // Use the --disable-gpu-watchdog command line switch to disable this. |