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

Unified Diff: base/timer/timer.cc

Issue 2958003002: Expose Timer::AbandonAndStop, so it can safely be destroyed on another thread. (Closed)
Patch Set: Removed AbandonAndStop and made Stop abandon. Created 3 years, 6 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') | no next file » | 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 1f6efcc7e3db704b60f2740f36e92b277734f1fd..6a64b9d357b4c0421dc2640236e4b0d56c682ebc 100644
--- a/base/timer/timer.cc
+++ b/base/timer/timer.cc
@@ -32,7 +32,7 @@ class BaseTimerTaskInternal {
// destructed. If so, don't leave Timer with a dangling pointer
// to this.
if (timer_)
- timer_->AbandonAndStop();
+ timer_->Stop();
}
void Run() {
@@ -100,7 +100,7 @@ Timer::Timer(const tracked_objects::Location& posted_from,
Timer::~Timer() {
DCHECK(origin_sequence_checker_.CalledOnValidSequence());
- AbandonAndStop();
+ Stop();
}
bool Timer::IsRunning() const {
@@ -142,6 +142,7 @@ void Timer::Stop() {
// RunScheduledTask(): https://crbug.com/587199.
// DCHECK(origin_sequence_checker_.CalledOnValidSequence());
+ AbandonScheduledTask();
is_running_ = false;
// It's safe to destroy or restart Timer on another sequence after Stop().
« no previous file with comments | « base/timer/timer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698