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

Unified Diff: components/gcm_driver/gcm_client_impl.cc

Issue 681453004: [GCM] Adding last token fetching time handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing Android build Created 6 years, 2 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 db4504ba2143defd2d6a9e8a4af0d6127c551d03..8fe3df7fb4eef2c0e033a5dee4f5e0ad439089d6 100644
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -328,12 +328,13 @@ void GCMClientImpl::OnLoadCompleted(scoped_ptr<GCMStore::LoadResult> result) {
// load result to InitializeMCSClient.
std::vector<AccountMapping> account_mappings;
account_mappings.swap(result->account_mappings);
+ base::Time last_token_fetch_time = result->last_token_fetch_time;
InitializeMCSClient(result.Pass());
if (device_checkin_info_.IsValid()) {
SchedulePeriodicCheckin();
- OnReady(account_mappings);
+ OnReady(account_mappings, last_token_fetch_time);
return;
}
@@ -387,15 +388,15 @@ void GCMClientImpl::OnFirstTimeDeviceCheckinCompleted(
base::Bind(&GCMClientImpl::SetDeviceCredentialsCallback,
weak_ptr_factory_.GetWeakPtr()));
- OnReady(std::vector<AccountMapping>());
+ OnReady(std::vector<AccountMapping>(), base::Time());
}
-void GCMClientImpl::OnReady(
- const std::vector<AccountMapping>& account_mappings) {
+void GCMClientImpl::OnReady(const std::vector<AccountMapping>& account_mappings,
+ const base::Time& last_token_fetch_time) {
state_ = READY;
StartMCSLogin();
- delegate_->OnGCMReady(account_mappings);
+ delegate_->OnGCMReady(account_mappings, last_token_fetch_time);
}
void GCMClientImpl::StartMCSLogin() {
@@ -470,6 +471,13 @@ void GCMClientImpl::RemoveAccountMapping(const std::string& account_id) {
weak_ptr_factory_.GetWeakPtr()));
}
+void GCMClientImpl::SetLastTokenFetchTime(const base::Time& time) {
+ gcm_store_->SetLastTokenFetchTime(
+ time,
+ base::Bind(&GCMClientImpl::DefaultStoreCallback,
+ weak_ptr_factory_.GetWeakPtr()));
+}
+
void GCMClientImpl::StartCheckin() {
// Make sure no checkin is in progress.
if (checkin_request_.get())
« 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