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

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: 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
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..a3abf3963b35686c19c129277a9ade77ca32e4f6 100644
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -321,11 +321,13 @@ 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);
+ std::vector<AccountMapping> account_mappings;
+ account_mappings.swap(result->account_mappings);
jianli 2014/09/24 21:21:31 Why can't we pass result->account_mappings to OnRe
fgorski 2014/09/24 22:25:40 Added comment as discussed.
InitializeMCSClient(result.Pass());
if (device_checkin_info_.IsValid()) {
SchedulePeriodicCheckin();
- OnReady();
+ OnReady(account_mappings);
return;
}
@@ -379,14 +381,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() {

Powered by Google App Engine
This is Rietveld 408576698