summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-15 22:25:44 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-15 22:25:44 +0000
commitb717e19314c2c238a15b848bb194c1bb38d811f2 (patch)
treef0970a43fc98f26cacdde94539c54f8c1032e446
parent43f2648cd1c4115602ef9617b058d7ba02aa2f2d (diff)
downloadchromium_src-b717e19314c2c238a15b848bb194c1bb38d811f2.zip
chromium_src-b717e19314c2c238a15b848bb194c1bb38d811f2.tar.gz
chromium_src-b717e19314c2c238a15b848bb194c1bb38d811f2.tar.bz2
Merge 217843 "Allow ProfileSyncService to initialize backend whe..."
> Allow ProfileSyncService to initialize backend when access token is not available. > > The problem is that when access token is not available ProfileSyncService > would initiate request to get access token but defer backend initialization > until that token arrives. When device has no network connectivity this > will take arbitrarily long time. > > The fix is to remove chech for access token and let ProfileSyncService > initialize backend. Later when syncer initiates RPC to server > ServerConnectionManager::PostBufferToPath will notice that auth_token is > empty and trigger auth error which in turn initiate request for new access > token. > > BUG=273096 > R=tim@chromium.org > > Review URL: https://codereview.chromium.org/23225002 TBR=tim@chromium.org Review URL: https://codereview.chromium.org/23180006 git-svn-id: svn://svn.chromium.org/chrome/branches/1547/src@217856 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/sync/profile_sync_service.cc5
-rw-r--r--sync/engine/net/server_connection_manager.cc6
2 files changed, 5 insertions, 6 deletions
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 9b1d75b..7b8e700 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -538,11 +538,6 @@ void ProfileSyncService::StartUp(StartUpDeferredOption deferred_option) {
DCHECK(IsSyncEnabledAndLoggedIn());
- if (use_oauth2_token_ && access_token_.empty()) {
- RequestAccessToken();
- return;
- }
-
if (start_up_time_.is_null()) {
start_up_time_ = base::Time::Now();
last_synced_time_ = sync_prefs_.GetLastSyncedTime();
diff --git a/sync/engine/net/server_connection_manager.cc b/sync/engine/net/server_connection_manager.cc
index 5cac362..7550985 100644
--- a/sync/engine/net/server_connection_manager.cc
+++ b/sync/engine/net/server_connection_manager.cc
@@ -267,7 +267,11 @@ bool ServerConnectionManager::PostBufferToPath(PostBufferParams* params,
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(watcher != NULL);
- if (auth_token.empty()) {
+ // TODO(pavely): crbug.com/273096. Check for "credentials_lost" is added as
+ // workaround for M29 blocker to avoid sending RPC to sync with known invalid
+ // token but instead to trigger refreshing token in ProfileSyncService. Need
+ // to clean it.
+ if (auth_token.empty() || auth_token == "credentials_lost") {
params->response.server_status = HttpResponse::SYNC_AUTH_ERROR;
return false;
}