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

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 10440007: Merge 138735 - No longer trigger SyncCredentialsLost flow on cros. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1132/src/
Patch Set: Created 8 years, 7 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 | chrome/browser/sync/profile_sync_service_startup_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service.cc
===================================================================
--- chrome/browser/sync/profile_sync_service.cc (revision 138738)
+++ chrome/browser/sync/profile_sync_service.cc (working copy)
@@ -206,8 +206,12 @@
return;
// Don't start the backend if the token service hasn't finished loading tokens
// yet (if the backend is started before the sync token has been loaded,
- // GetCredentials() will return bogus credentials).
- if (IsSyncTokenAvailable() || token_service->TokensLoadedFromDB()) {
+ // GetCredentials() will return bogus credentials). On auto_start platforms
+ // (like ChromeOS) we don't start sync until tokens are loaded, because the
+ // user can be "signed in" on those platforms long before the tokens get
+ // loaded, and we don't want to generate spurious auth errors.
+ if (IsSyncTokenAvailable() ||
+ (!auto_start_enabled_ && token_service->TokensLoadedFromDB())) {
if (HasSyncSetupCompleted() || auto_start_enabled_) {
// If sync setup has completed we always start the backend.
// If autostart is enabled, but we haven't completed sync setup, we try to
@@ -1545,6 +1549,12 @@
// This notification gets fired when TokenService loads the tokens
// from storage.
if (IsSyncEnabledAndLoggedIn()) {
+ // Don't start up sync and generate an auth error on auto_start
+ // platforms as they have their own way to resolve TokenService errors.
+ // (crbug.com/128592).
+ if (auto_start_enabled_ && !IsSyncTokenAvailable())
+ break;
+
// Initialize the backend if sync is enabled. If the sync token was
// not loaded, GetCredentials() will generate invalid credentials to
// cause the backend to generate an auth error (crbug.com/121755).
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service_startup_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698