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

Unified Diff: components/browser_sync/profile_sync_service.cc

Issue 2624943002: [Sync] Move snapshot cache from SBHI to PSS. (Closed)
Patch Set: Created 3 years, 11 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/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 {

Powered by Google App Engine
This is Rietveld 408576698