Chromium Code Reviews| Index: components/browser_sync/profile_sync_service.cc |
| diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc |
| index c17718f64871c53878e870b9fa6bc8309f0fd5de..377c1e53aee9c2b2df9ad417a433beb28bafe893 100644 |
| --- a/components/browser_sync/profile_sync_service.cc |
| +++ b/components/browser_sync/profile_sync_service.cc |
| @@ -1023,10 +1023,16 @@ void ProfileSyncService::OnEngineInitialized( |
| RequestStart(); |
| } |
| -void ProfileSyncService::OnSyncCycleCompleted() { |
| +void ProfileSyncService::OnSyncCycleCompleted( |
| + const syncer::SyncCycleSnapshot& snapshot) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| + |
| + last_snapshot_ = snapshot; |
| + |
| UpdateLastSyncedTime(); |
| - const syncer::SyncCycleSnapshot snapshot = GetLastCycleSnapshot(); |
| + if (!snapshot.poll_finish_time().is_null()) |
| + sync_prefs_.SetLastPollTime(snapshot.poll_finish_time()); |
| + |
| if (IsDataTypeControllerRunning(syncer::SESSIONS) && |
| snapshot.model_neutral_state().get_updates_request_types.Has( |
| syncer::SESSIONS) && |
| @@ -1866,9 +1872,7 @@ syncer::UserShare* ProfileSyncService::GetUserShare() const { |
| syncer::SyncCycleSnapshot ProfileSyncService::GetLastCycleSnapshot() const { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| - if (engine_) |
| - return engine_->GetLastCycleSnapshot(); |
| - return syncer::SyncCycleSnapshot(); |
| + return last_snapshot_; |
|
pavely
2017/01/12 00:27:13
Previously if user signs out this method would ret
maxbogue
2017/01/12 01:55:02
Hmm... I'm going to clear it in ShutdownImpl just
|
| } |
| bool ProfileSyncService::HasUnsyncedItems() const { |