| 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())
|
|
|