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

Unified Diff: base/timer/timer.cc

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 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
« no previous file with comments | « base/timer/timer.h ('k') | base/trace_event/memory_dump_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/timer/timer.cc
diff --git a/base/timer/timer.cc b/base/timer/timer.cc
index 11f73ca4290e4947a537cfa370dadcef7dca85d5..fa6b8cd2724a034ecf7d5fea48bad4e41884ee97 100644
--- a/base/timer/timer.cc
+++ b/base/timer/timer.cc
@@ -163,8 +163,10 @@ void Timer::PostNewScheduledTask(TimeDelta delay) {
}
// Remember the thread ID that posts the first task -- this will be verified
// later when the task is abandoned to detect misuse from multiple threads.
- if (!thread_id_)
+ if (!thread_id_) {
+ DCHECK(GetTaskRunner()->BelongsToCurrentThread());
thread_id_ = static_cast<int>(PlatformThread::CurrentId());
+ }
}
scoped_refptr<SingleThreadTaskRunner> Timer::GetTaskRunner() {
« no previous file with comments | « base/timer/timer.h ('k') | base/trace_event/memory_dump_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698