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

Unified Diff: base/run_loop.cc

Issue 2537893002: Add thread checking to RunLoop, deprecate MessageLoopRunner. (Closed)
Patch Set: Fix errors caught by ThreadChecker. Created 4 years 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: base/run_loop.cc
diff --git a/base/run_loop.cc b/base/run_loop.cc
index a2322f849582c3b22cc78b9c9980b3fd8a1a92b8..6faaeee2ba323d505e1d2ad09490455953e5b3c4 100644
--- a/base/run_loop.cc
+++ b/base/run_loop.cc
@@ -25,6 +25,7 @@ RunLoop::~RunLoop() {
}
void RunLoop::Run() {
+ DCHECK(thread_checker_.CalledOnValidThread());
if (!BeforeRun())
return;
@@ -44,6 +45,7 @@ void RunLoop::RunUntilIdle() {
}
void RunLoop::Quit() {
+ DCHECK(thread_checker_.CalledOnValidThread());
quit_called_ = true;
if (running_ && loop_->run_loop_ == this) {
// This is the inner-most RunLoop, so quit now.
@@ -52,6 +54,7 @@ void RunLoop::Quit() {
}
void RunLoop::QuitWhenIdle() {
+ DCHECK(thread_checker_.CalledOnValidThread());
quit_when_idle_received_ = true;
}

Powered by Google App Engine
This is Rietveld 408576698