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

Unified Diff: components/gcm_driver/gcm_client_impl.cc

Issue 600053002: [GCM] Loading the account mappings from store to the driver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing account mapper from BUILD.gn android section 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 d1fc7a08851675aba29f11d23e8b5f872664d0b5..57a665a8ed5b5159bb0db207f6025f194f80d280 100644
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -321,11 +321,16 @@ void GCMClientImpl::OnLoadCompleted(scoped_ptr<GCMStore::LoadResult> result) {
device_checkin_info_.accounts_set = true;
last_checkin_time_ = result->last_checkin_time;
gservices_settings_.UpdateFromLoadResult(*result);
+ // Taking over the value of account_mappings before passing the ownership of
+ // load result to InitializeMCSClient.
+ std::vector<AccountMapping> account_mappings;
+ account_mappings.swap(result->account_mappings);
+
InitializeMCSClient(result.Pass());
if (device_checkin_info_.IsValid()) {
SchedulePeriodicCheckin();
- OnReady();
+ OnReady(account_mappings);
return;
}
@@ -379,14 +384,15 @@ void GCMClientImpl::OnFirstTimeDeviceCheckinCompleted(
base::Bind(&GCMClientImpl::SetDeviceCredentialsCallback,
weak_ptr_factory_.GetWeakPtr()));
- OnReady();
+ OnReady(std::vector<AccountMapping>());
}
-void GCMClientImpl::OnReady() {
+void GCMClientImpl::OnReady(
+ const std::vector<AccountMapping>& account_mappings) {
state_ = READY;
StartMCSLogin();
- delegate_->OnGCMReady();
+ delegate_->OnGCMReady(account_mappings);
}
void GCMClientImpl::StartMCSLogin() {
« 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