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

Unified Diff: components/sync/engine_impl/sync_scheduler_impl.cc

Issue 2494873003: [Sync] Allow sync start without sign-in if the local sync backend is on. (Closed)
Patch Set: Rebased on ToT. Created 4 years, 1 month 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: components/sync/engine_impl/sync_scheduler_impl.cc
diff --git a/components/sync/engine_impl/sync_scheduler_impl.cc b/components/sync/engine_impl/sync_scheduler_impl.cc
index fe52722f06229f13fd092c27807bf8715bc9d0be..616c0ada63f60e131c0ffffabe5b964c909622e3 100644
--- a/components/sync/engine_impl/sync_scheduler_impl.cc
+++ b/components/sync/engine_impl/sync_scheduler_impl.cc
@@ -151,7 +151,8 @@ GetUpdatesCallerInfo::GetUpdatesSource GetUpdatesFromNudgeSource(
SyncSchedulerImpl::SyncSchedulerImpl(const std::string& name,
BackoffDelayProvider* delay_provider,
SyncCycleContext* context,
- Syncer* syncer)
+ Syncer* syncer,
+ bool local_sync_backend_enabled)
: name_(name),
started_(false),
syncer_short_poll_interval_seconds_(
@@ -163,6 +164,7 @@ SyncSchedulerImpl::SyncSchedulerImpl(const std::string& name,
syncer_(syncer),
cycle_context_(context),
next_sync_cycle_job_priority_(NORMAL_PRIORITY),
+ local_sync_backend_enabled_(local_sync_backend_enabled),
weak_ptr_factory_(this),
weak_ptr_factory_for_weak_handle_(this) {
weak_handle_this_ =
@@ -337,7 +339,8 @@ bool SyncSchedulerImpl::CanRunJobNow(JobPriority priority) {
return false;
}
- if (cycle_context_->connection_manager()->HasInvalidAuthToken()) {
+ if (!local_sync_backend_enabled_ &&
+ cycle_context_->connection_manager()->HasInvalidAuthToken()) {
SDVLOG(1) << "Unable to run a job because we have no valid auth token.";
return false;
}

Powered by Google App Engine
This is Rietveld 408576698