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

Unified Diff: components/gcm_driver/gcm_client_impl.cc

Issue 594383003: [GCM] Passing GCMClient::AccountTokenInfo list to GCMDriver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@account-mapper
Patch Set: Addressing CR comments Created 6 years, 3 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 | « components/gcm_driver/gcm_client_impl.h ('k') | components/gcm_driver/gcm_client_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_client_impl.cc
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc
index 57a665a8ed5b5159bb0db207f6025f194f80d280..a916b7c8fd093b34741d7639337dd326525f89c2 100644
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -407,10 +407,17 @@ void GCMClientImpl::ResetState() {
// TODO(fgorski): reset all of the necessart objects and start over.
}
-void GCMClientImpl::SetAccountsForCheckin(
- const std::map<std::string, std::string>& account_tokens) {
+void GCMClientImpl::SetAccountTokens(
+ const std::vector<AccountTokenInfo>& account_tokens) {
+ device_checkin_info_.account_tokens.clear();
+ for (std::vector<AccountTokenInfo>::const_iterator iter =
+ account_tokens.begin();
+ iter != account_tokens.end();
+ ++iter) {
+ device_checkin_info_.account_tokens[iter->email] = iter->access_token;
+ }
+
bool accounts_set_before = device_checkin_info_.accounts_set;
- device_checkin_info_.account_tokens = account_tokens;
device_checkin_info_.accounts_set = true;
DVLOG(1) << "Set account called with: " << account_tokens.size()
@@ -424,8 +431,10 @@ void GCMClientImpl::SetAccountsForCheckin(
device_checkin_info_.last_checkin_accounts.begin();
iter != device_checkin_info_.last_checkin_accounts.end();
++iter) {
- if (account_tokens.find(*iter) == account_tokens.end())
+ if (device_checkin_info_.account_tokens.find(*iter) ==
+ device_checkin_info_.account_tokens.end()) {
account_removed = true;
+ }
}
// Checkin will be forced when any of the accounts was removed during the
« no previous file with comments | « components/gcm_driver/gcm_client_impl.h ('k') | components/gcm_driver/gcm_client_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698