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

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: Remove ifdefs around include. Created 4 years 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 edc26fc58f176af6afd20e40941eb1536a910626..69559b513ea342ed2c36229a5aea643c48e91bb8 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 ignore_auth_credentials)
: 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),
+ ignore_auth_credentials_(ignore_auth_credentials),
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 (!ignore_auth_credentials_ &&
+ cycle_context_->connection_manager()->HasInvalidAuthToken()) {
SDVLOG(1) << "Unable to run a job because we have no valid auth token.";
return false;
}
« no previous file with comments | « components/sync/engine_impl/sync_scheduler_impl.h ('k') | components/sync/engine_impl/sync_scheduler_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698