From b2565823ffd83289eb2d092bb3f4db877a50408e Mon Sep 17 00:00:00 2001 From: "mmontgomery@chromium.org" Date: Mon, 15 Oct 2012 19:18:15 +0000 Subject: [sync] Refactor SyncSessionSnapshot to use new ProgressMarkerMap. This is the first step in refactoring the Sync integration tests to use progress markers to detect quiescence. This will save that mechanism from having to round-trip progress markers through multiple encodings. We can instead use protobufs' existing serialization/deserialization methods. BUG= Review URL: https://chromiumcodereview.appspot.com/10986004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161918 0039d316-1c4b-4281-b951-d872f2087c98 --- sync/sessions/session_state_unittest.cc | 8 ++++---- sync/sessions/sync_session.cc | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'sync/sessions') diff --git a/sync/sessions/session_state_unittest.cc b/sync/sessions/session_state_unittest.cc index 3b3daea..9d20437 100644 --- a/sync/sessions/session_state_unittest.cc +++ b/sync/sessions/session_state_unittest.cc @@ -61,11 +61,11 @@ TEST_F(SessionStateTest, SyncSessionSnapshotToValue) { scoped_ptr expected_initial_sync_ended_value( ModelTypeSetToValue(initial_sync_ended)); - ModelTypeInvalidationMap download_progress_markers; - download_progress_markers[BOOKMARKS].payload = "test"; - download_progress_markers[APPS].payload = "apps"; + ProgressMarkerMap download_progress_markers; + download_progress_markers[BOOKMARKS] = "test"; + download_progress_markers[APPS] = "apps"; scoped_ptr expected_download_progress_markers_value( - ModelTypeInvalidationMapToValue(download_progress_markers)); + ProgressMarkerMapToValue(download_progress_markers)); const bool kHasMoreToSync = false; const bool kIsSilenced = true; diff --git a/sync/sessions/sync_session.cc b/sync/sessions/sync_session.cc index b6a9ff3..5586819 100644 --- a/sync/sessions/sync_session.cc +++ b/sync/sessions/sync_session.cc @@ -157,7 +157,7 @@ SyncSessionSnapshot SyncSession::TakeSnapshot() const { bool is_share_useable = true; ModelTypeSet initial_sync_ended; - ModelTypeInvalidationMap download_progress_markers; + ProgressMarkerMap download_progress_markers; for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) { ModelType type(ModelTypeFromInt(i)); if (routing_info_.count(type) != 0) { @@ -166,10 +166,7 @@ SyncSessionSnapshot SyncSession::TakeSnapshot() const { else is_share_useable = false; } - // TODO(dcheng): Is this correct? I'm guessing GetDownloadProgressAsString() - // shouldn't care about the ack handle... - dir->GetDownloadProgressAsString(type, - &download_progress_markers[type].payload); + dir->GetDownloadProgressAsString(type, &download_progress_markers[type]); } return SyncSessionSnapshot( -- cgit v1.1