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

Unified Diff: sync/engine/sync_scheduler_impl.cc

Issue 11827013: sync: speculative fix for bug 165561 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | « no previous file | no next file » | 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 76a72f03272b1f69efa44b45115561aabe8359e5..f07825e669f127ccd779f66a2d257b4a9ca93acf 100644
--- a/sync/engine/sync_scheduler_impl.cc
+++ b/sync/engine/sync_scheduler_impl.cc
@@ -316,6 +316,7 @@ bool SyncSchedulerImpl::ScheduleConfiguration(
DCHECK(IsConfigRelatedUpdateSourceValue(params.source));
DCHECK_EQ(CONFIGURATION_MODE, mode_);
DCHECK(!params.ready_task.is_null());
+ CHECK(started_) << "Scheduler must be running to configure.";
SDVLOG(2) << "Reconfiguring syncer.";
// Only one configuration is allowed at a time. Verify we're not waiting
@@ -594,6 +595,12 @@ void SyncSchedulerImpl::ScheduleNudgeImpl(
DCHECK_EQ(MessageLoop::current(), sync_loop_);
DCHECK(!invalidation_map.empty()) << "Nudge scheduled for no types!";
+ if (!started_) {
+ SDVLOG_LOC(nudge_location, 2)
+ << "Dropping nudge, scheduler is not running.";
+ return;
+ }
+
SDVLOG_LOC(nudge_location, 2)
<< "In ScheduleNudgeImpl with delay "
<< delay.InMilliseconds() << " ms, "
@@ -992,6 +999,8 @@ void SyncSchedulerImpl::StopImpl(const base::Closure& callback) {
weak_ptr_factory_.InvalidateWeakPtrs();
wait_interval_.reset();
poll_timer_.Stop();
+ unscheduled_nudge_storage_.reset();
+ pending_nudge_ = NULL;
if (started_) {
started_ = false;
}
« 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