diff options
author | mmontgomery@chromium.org <mmontgomery@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-15 19:18:15 +0000 |
---|---|---|
committer | mmontgomery@chromium.org <mmontgomery@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-15 19:18:15 +0000 |
commit | b2565823ffd83289eb2d092bb3f4db877a50408e (patch) | |
tree | 7d72f181e951e69a394d83d911f8a3c583335b89 /sync/sessions | |
parent | 8969385b1fc69d8077083bb92ba4b595210f5696 (diff) | |
download | chromium_src-b2565823ffd83289eb2d092bb3f4db877a50408e.zip chromium_src-b2565823ffd83289eb2d092bb3f4db877a50408e.tar.gz chromium_src-b2565823ffd83289eb2d092bb3f4db877a50408e.tar.bz2 |
[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
Diffstat (limited to 'sync/sessions')
-rw-r--r-- | sync/sessions/session_state_unittest.cc | 8 | ||||
-rw-r--r-- | sync/sessions/sync_session.cc | 7 |
2 files changed, 6 insertions, 9 deletions
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<ListValue> 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<DictionaryValue> 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( |