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

Unified Diff: chrome/gpu/gpu_watchdog_thread.cc

Issue 5301007: Fixed null dereference in GPU watchdog termination code.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698