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

Unified Diff: sync/engine/sync_scheduler_impl.cc

Issue 11341030: sync: reland scheduler ownership refactoring, now with less crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 8 years, 2 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 | « sync/engine/sync_scheduler_impl.h ('k') | sync/engine/sync_scheduler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/sync_scheduler_impl.cc
diff --git a/sync/engine/sync_scheduler_impl.cc b/sync/engine/sync_scheduler_impl.cc
index 4d1f9a8fe99c0fb1f1f07e51ce2c897a187bccf5..c270fc525f31819f193813d70cb87614756a3345 100644
--- a/sync/engine/sync_scheduler_impl.cc
+++ b/sync/engine/sync_scheduler_impl.cc
@@ -1021,6 +1021,7 @@ void SyncSchedulerImpl::DoCanaryJob(scoped_ptr<SyncSessionJob> to_be_canary) {
to_be_canary->GrantCanaryPrivilege();
if (to_be_canary->purpose() == SyncSessionJob::NUDGE) {
+ DCHECK_EQ(pending_nudge_->session(), to_be_canary->session());
// TODO(tim): We should be able to remove this...
scoped_ptr<SyncSession> temp = CreateSyncSession(
to_be_canary->session()->source()).Pass();
@@ -1048,6 +1049,9 @@ scoped_ptr<SyncSessionJob> SyncSchedulerImpl::TakePendingJobForCurrentMode() {
pending_nudge_ = candidate.get();
unscheduled_nudge_storage_.reset();
}
+ // If we took a job and there's a wait interval, we took the pending canary.
+ if (candidate && wait_interval_)
+ wait_interval_->timer.Stop();
rlarocque 2012/10/30 17:50:20 What if the timer fires somewhere between this lin
tim (not reviewing) 2012/10/30 17:58:29 Everything happens on the same message loop, so if
return candidate.Pass();
}
« no previous file with comments | « sync/engine/sync_scheduler_impl.h ('k') | sync/engine/sync_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698