summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/engine/syncapi.cc
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 23:00:24 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 23:00:24 +0000
commitd817d588b3ae045babe6fcaee8f119fd50f1404c (patch)
tree93f6395e7362b098dd62ba8a55d09e340e3ca40c /chrome/browser/sync/engine/syncapi.cc
parent9e7dc7fe4ddcf0c362fc180aeac029f6ea846b1a (diff)
downloadchromium_src-d817d588b3ae045babe6fcaee8f119fd50f1404c.zip
chromium_src-d817d588b3ae045babe6fcaee8f119fd50f1404c.tar.gz
chromium_src-d817d588b3ae045babe6fcaee8f119fd50f1404c.tar.bz2
If chrome starts without a network connection, the sync serverconnectionmanager won't get an auth_token set until
the Authenticator validates it. We had a bug where when we come online and the server connection manager determines that a server is reachable, we would drop the request to authenticate (which is the first step in getting the auth token set properly). This was resulting in subsequent requests returning 401 UNAUTHORIZED, and sync getting stuck in an offline state. The fix is to set the auth token on startup, so the gaia authenticator and server connection manager start off on the same page. BUG=24973 TEST=setup sync, shutdown chrome. ipconfig /release, start chrome, ipconfig /renew. about:sync shoudl show 'READY'. Review URL: http://codereview.chromium.org/285008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29350 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/engine/syncapi.cc')
-rw-r--r--chrome/browser/sync/engine/syncapi.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index 099f831..0edc70d 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -1154,6 +1154,10 @@ void SyncManager::SyncInternal::AuthenticateForLastKnownUser() {
MarkAndNotifyInitializationComplete();
}
+ // Load the last-known good auth token into the connection manager and send
+ // it off to the AuthWatcher for validation. The result of the validation
+ // will update the connection manager if necessary.
+ connection_manager()->set_auth_token(auth_token);
auth_watcher()->AuthenticateWithToken(username, auth_token);
}