summaryrefslogtreecommitdiffstats
path: root/sync/sessions
diff options
context:
space:
mode:
authordcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-04 03:53:09 +0000
committerdcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-04 03:53:09 +0000
commit3e31fa4b5ee25f9f7411e8881177321987a80463 (patch)
tree14f6f5932096406a21129ceb551434ea953f5dff /sync/sessions
parentde256cd48dd8e5617cfce42d7c1aeebb4cbb13f8 (diff)
downloadchromium_src-3e31fa4b5ee25f9f7411e8881177321987a80463.zip
chromium_src-3e31fa4b5ee25f9f7411e8881177321987a80463.tar.gz
chromium_src-3e31fa4b5ee25f9f7411e8881177321987a80463.tar.bz2
Rename ModelType/ObjectIdStateMap to InvalidationMap.
BUG=none TBR=sky Review URL: https://chromiumcodereview.appspot.com/11052007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160073 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/sessions')
-rw-r--r--sync/sessions/session_state_unittest.cc8
-rw-r--r--sync/sessions/sync_session.cc10
-rw-r--r--sync/sessions/sync_session_unittest.cc40
3 files changed, 29 insertions, 29 deletions
diff --git a/sync/sessions/session_state_unittest.cc b/sync/sessions/session_state_unittest.cc
index 1069e94..3b3daea 100644
--- a/sync/sessions/session_state_unittest.cc
+++ b/sync/sessions/session_state_unittest.cc
@@ -30,11 +30,11 @@ class SessionStateTest : public testing::Test {};
TEST_F(SessionStateTest, SyncSourceInfoToValue) {
sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source =
sync_pb::GetUpdatesCallerInfo::PERIODIC;
- ModelTypeStateMap types;
+ ModelTypeInvalidationMap types;
types[PREFERENCES].payload = "preferencespayload";
types[EXTENSIONS].payload = "";
scoped_ptr<DictionaryValue> expected_types_value(
- ModelTypeStateMapToValue(types));
+ ModelTypeInvalidationMapToValue(types));
SyncSourceInfo source_info(updates_source, types);
@@ -61,11 +61,11 @@ TEST_F(SessionStateTest, SyncSessionSnapshotToValue) {
scoped_ptr<ListValue> expected_initial_sync_ended_value(
ModelTypeSetToValue(initial_sync_ended));
- ModelTypeStateMap download_progress_markers;
+ ModelTypeInvalidationMap download_progress_markers;
download_progress_markers[BOOKMARKS].payload = "test";
download_progress_markers[APPS].payload = "apps";
scoped_ptr<DictionaryValue> expected_download_progress_markers_value(
- ModelTypeStateMapToValue(download_progress_markers));
+ ModelTypeInvalidationMapToValue(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 b2be0e5..9806425 100644
--- a/sync/sessions/sync_session.cc
+++ b/sync/sessions/sync_session.cc
@@ -48,17 +48,17 @@ std::set<ModelSafeGroup> ComputeEnabledGroups(
return enabled_groups;
}
-void PurgeStaleStates(ModelTypeStateMap* original,
+void PurgeStaleStates(ModelTypeInvalidationMap* original,
const ModelSafeRoutingInfo& routing_info) {
- std::vector<ModelTypeStateMap::iterator> iterators_to_delete;
- for (ModelTypeStateMap::iterator i = original->begin();
+ std::vector<ModelTypeInvalidationMap::iterator> iterators_to_delete;
+ for (ModelTypeInvalidationMap::iterator i = original->begin();
i != original->end(); ++i) {
if (routing_info.end() == routing_info.find(i->first)) {
iterators_to_delete.push_back(i);
}
}
- for (std::vector<ModelTypeStateMap::iterator>::iterator
+ for (std::vector<ModelTypeInvalidationMap::iterator>::iterator
it = iterators_to_delete.begin(); it != iterators_to_delete.end();
++it) {
original->erase(*it);
@@ -157,7 +157,7 @@ SyncSessionSnapshot SyncSession::TakeSnapshot() const {
bool is_share_useable = true;
ModelTypeSet initial_sync_ended;
- ModelTypeStateMap download_progress_markers;
+ ModelTypeInvalidationMap 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) {
diff --git a/sync/sessions/sync_session_unittest.cc b/sync/sessions/sync_session_unittest.cc
index bc69fe8..d187ce6 100644
--- a/sync/sessions/sync_session_unittest.cc
+++ b/sync/sessions/sync_session_unittest.cc
@@ -12,7 +12,7 @@
#include "sync/engine/syncer_types.h"
#include "sync/engine/throttled_data_type_tracker.h"
#include "sync/internal_api/public/base/model_type.h"
-#include "sync/internal_api/public/base/model_type_state_map_test_util.h"
+#include "sync/internal_api/public/base/model_type_invalidation_map_test_util.h"
#include "sync/sessions/session_state.h"
#include "sync/sessions/status_controller.h"
#include "sync/syncable/syncable_id.h"
@@ -273,12 +273,12 @@ TEST_F(SyncSessionTest, ResetTransientState) {
TEST_F(SyncSessionTest, Coalesce) {
std::vector<ModelSafeWorker*> workers_one, workers_two;
ModelSafeRoutingInfo routes_one, routes_two;
- ModelTypeStateMap one_type =
- ModelTypeSetToStateMap(
+ ModelTypeInvalidationMap one_type =
+ ModelTypeSetToInvalidationMap(
ParamsMeaningJustOneEnabledType(),
std::string());
- ModelTypeStateMap all_types =
- ModelTypeSetToStateMap(
+ ModelTypeInvalidationMap all_types =
+ ModelTypeSetToInvalidationMap(
ParamsMeaningAllEnabledTypes(),
std::string());
SyncSourceInfo source_one(sync_pb::GetUpdatesCallerInfo::PERIODIC, one_type);
@@ -330,12 +330,12 @@ TEST_F(SyncSessionTest, Coalesce) {
TEST_F(SyncSessionTest, RebaseRoutingInfoWithLatestRemoveOneType) {
std::vector<ModelSafeWorker*> workers_one, workers_two;
ModelSafeRoutingInfo routes_one, routes_two;
- ModelTypeStateMap one_type =
- ModelTypeSetToStateMap(
+ ModelTypeInvalidationMap one_type =
+ ModelTypeSetToInvalidationMap(
ParamsMeaningJustOneEnabledType(),
std::string());
- ModelTypeStateMap all_types =
- ModelTypeSetToStateMap(
+ ModelTypeInvalidationMap all_types =
+ ModelTypeSetToInvalidationMap(
ParamsMeaningAllEnabledTypes(),
std::string());
SyncSourceInfo source_one(sync_pb::GetUpdatesCallerInfo::PERIODIC, one_type);
@@ -402,8 +402,8 @@ TEST_F(SyncSessionTest, RebaseRoutingInfoWithLatestRemoveOneType) {
TEST_F(SyncSessionTest, RebaseRoutingInfoWithLatestWithSameType) {
std::vector<ModelSafeWorker*> workers_first, workers_second;
ModelSafeRoutingInfo routes_first, routes_second;
- ModelTypeStateMap all_types =
- ModelTypeSetToStateMap(
+ ModelTypeInvalidationMap all_types =
+ ModelTypeSetToInvalidationMap(
ParamsMeaningAllEnabledTypes(),
std::string());
SyncSourceInfo source_first(sync_pb::GetUpdatesCallerInfo::PERIODIC,
@@ -482,23 +482,23 @@ TEST_F(SyncSessionTest, RebaseRoutingInfoWithLatestWithSameType) {
}
-TEST_F(SyncSessionTest, MakeTypeStateMapFromBitSet) {
+TEST_F(SyncSessionTest, MakeTypeInvalidationMapFromBitSet) {
ModelTypeSet types;
std::string payload = "test";
- ModelTypeStateMap type_state_map =
- ModelTypeSetToStateMap(types, payload);
- EXPECT_TRUE(type_state_map.empty());
+ ModelTypeInvalidationMap invalidation_map =
+ ModelTypeSetToInvalidationMap(types, payload);
+ EXPECT_TRUE(invalidation_map.empty());
types.Put(BOOKMARKS);
types.Put(PASSWORDS);
types.Put(AUTOFILL);
payload = "test2";
- type_state_map = ModelTypeSetToStateMap(types, payload);
+ invalidation_map = ModelTypeSetToInvalidationMap(types, payload);
- ASSERT_EQ(3U, type_state_map.size());
- EXPECT_EQ(type_state_map[BOOKMARKS].payload, payload);
- EXPECT_EQ(type_state_map[PASSWORDS].payload, payload);
- EXPECT_EQ(type_state_map[AUTOFILL].payload, payload);
+ ASSERT_EQ(3U, invalidation_map.size());
+ EXPECT_EQ(invalidation_map[BOOKMARKS].payload, payload);
+ EXPECT_EQ(invalidation_map[PASSWORDS].payload, payload);
+ EXPECT_EQ(invalidation_map[AUTOFILL].payload, payload);
}
} // namespace