summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync
diff options
context:
space:
mode:
authorpetewil@chromium.org <petewil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-01 22:49:43 +0000
committerpetewil@chromium.org <petewil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-01 22:49:43 +0000
commit18b82392e590540cec2a2fe19bf03b8231ded49e (patch)
tree8b20abbce0aca7f5a9059941ef63656d1db4359c /chrome/browser/sync
parentee62ae2d075c19e0c327dbc0e3a4e1d78413786d (diff)
downloadchromium_src-18b82392e590540cec2a2fe19bf03b8231ded49e.zip
chromium_src-18b82392e590540cec2a2fe19bf03b8231ded49e.tar.gz
chromium_src-18b82392e590540cec2a2fe19bf03b8231ded49e.tar.bz2
Cache the channel ID
To prevent hitting rate limits on how fast we can access the server to get an auth token to get a channel Id, we cache the channel Id when we get one. Note that a channel Id is per profile, so we store them by profile login name. BUG=149733 Review URL: https://chromiumcodereview.appspot.com/10951022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159576 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r--chrome/browser/sync/glue/sync_backend_host.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index a8a50ff..e235cf7 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -24,6 +24,7 @@
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/token_service.h"
+#include "chrome/browser/signin/token_service_factory.h"
#include "chrome/browser/sync/glue/bridged_invalidator.h"
#include "chrome/browser/sync/glue/change_processor.h"
#include "chrome/browser/sync/glue/chrome_encryptor.h"
@@ -1491,10 +1492,10 @@ void SyncBackendHost::NotifyPassphraseAccepted() {
void SyncBackendHost::NotifyUpdatedToken(const std::string& token) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
TokenAvailableDetails details(GaiaConstants::kSyncService, token);
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_TOKEN_UPDATED,
- content::Source<Profile>(profile_),
- content::Details<const TokenAvailableDetails>(&details));
+
+ TokenService* token_service = TokenServiceFactory::GetForProfile(profile_);
+ CHECK(token_service);
+ token_service->AddAuthTokenManually(details.service(), details.token());
}
void SyncBackendHost::NotifyEncryptedTypesChanged(