summaryrefslogtreecommitdiffstats
path: root/chrome/browser
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 /chrome/browser
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 'chrome/browser')
-rw-r--r--chrome/browser/chrome_to_mobile_service.cc6
-rw-r--r--chrome/browser/chrome_to_mobile_service.h2
-rw-r--r--chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler.cc6
-rw-r--r--chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler.h2
-rw-r--r--chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler_unittest.cc4
-rw-r--r--chrome/browser/sync/glue/bridged_invalidator.cc4
-rw-r--r--chrome/browser/sync/glue/bridged_invalidator.h2
-rw-r--r--chrome/browser/sync/glue/bridged_invalidator_unittest.cc16
-rw-r--r--chrome/browser/sync/glue/chrome_sync_notification_bridge.cc26
-rw-r--r--chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc58
-rw-r--r--chrome/browser/sync/glue/session_change_processor.cc11
-rw-r--r--chrome/browser/sync/glue/session_model_associator.cc11
-rw-r--r--chrome/browser/sync/glue/sync_backend_host.cc10
-rw-r--r--chrome/browser/sync/glue/sync_backend_host.h2
-rw-r--r--chrome/browser/sync/glue/sync_backend_host_unittest.cc18
-rw-r--r--chrome/browser/sync/profile_sync_service.cc11
-rw-r--r--chrome/browser/sync/profile_sync_service.h2
-rw-r--r--chrome/browser/sync/profile_sync_service_unittest.cc14
-rw-r--r--chrome/browser/sync/test/integration/sync_test.cc4
-rw-r--r--chrome/browser/sync/test_profile_sync_service.cc4
-rw-r--r--chrome/browser/sync/test_profile_sync_service.h2
21 files changed, 111 insertions, 104 deletions
diff --git a/chrome/browser/chrome_to_mobile_service.cc b/chrome/browser/chrome_to_mobile_service.cc
index 9aec57a..7061628 100644
--- a/chrome/browser/chrome_to_mobile_service.cc
+++ b/chrome/browser/chrome_to_mobile_service.cc
@@ -425,10 +425,10 @@ void ChromeToMobileService::OnInvalidatorStateChange(
}
void ChromeToMobileService::OnIncomingInvalidation(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource source) {
- DCHECK_EQ(1U, id_state_map.size());
- DCHECK_EQ(1U, id_state_map.count(invalidation::ObjectId(
+ DCHECK_EQ(1U, invalidation_map.size());
+ DCHECK_EQ(1U, invalidation_map.count(invalidation::ObjectId(
ipc::invalidation::ObjectSource::CHROME_COMPONENTS,
kSyncInvalidationObjectIdChromeToMobileDeviceList)));
RequestDeviceSearch();
diff --git a/chrome/browser/chrome_to_mobile_service.h b/chrome/browser/chrome_to_mobile_service.h
index 4fd2472..191e8b7 100644
--- a/chrome/browser/chrome_to_mobile_service.h
+++ b/chrome/browser/chrome_to_mobile_service.h
@@ -173,7 +173,7 @@ class ChromeToMobileService : public ProfileKeyedService,
virtual void OnInvalidatorStateChange(
syncer::InvalidatorState state) OVERRIDE;
virtual void OnIncomingInvalidation(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource source) OVERRIDE;
// Expose access token accessors for test purposes.
diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler.cc b/chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler.cc
index 882dfe8..cee8305e 100644
--- a/chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler.cc
+++ b/chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler.cc
@@ -119,11 +119,11 @@ void PushMessagingInvalidationHandler::OnInvalidatorStateChange(
}
void PushMessagingInvalidationHandler::OnIncomingInvalidation(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource source) {
DCHECK(thread_checker_.CalledOnValidThread());
- for (syncer::ObjectIdStateMap::const_iterator it = id_state_map.begin();
- it != id_state_map.end(); ++it) {
+ for (syncer::ObjectIdInvalidationMap::const_iterator it =
+ invalidation_map.begin(); it != invalidation_map.end(); ++it) {
std::string extension_id;
int subchannel;
if (ObjectIdToExtensionAndSubchannel(it->first,
diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler.h b/chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler.h
index 52ec385..7d61598 100644
--- a/chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler.h
+++ b/chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler.h
@@ -43,7 +43,7 @@ class PushMessagingInvalidationHandler : public PushMessagingInvalidationMapper,
virtual void OnInvalidatorStateChange(
syncer::InvalidatorState state) OVERRIDE;
virtual void OnIncomingInvalidation(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource source) OVERRIDE;
const std::set<std::string>& GetRegisteredExtensionsForTest() const {
diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler_unittest.cc b/chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler_unittest.cc
index 1db7eaf..599998b 100644
--- a/chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler_unittest.cc
+++ b/chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler_unittest.cc
@@ -164,7 +164,7 @@ TEST_F(PushMessagingInvalidationHandlerTest, Dispatch) {
OnMessage("dddddddddddddddddddddddddddddddd", 0, "payload"));
EXPECT_CALL(delegate_,
OnMessage("dddddddddddddddddddddddddddddddd", 3, "payload"));
- handler_->OnIncomingInvalidation(ObjectIdSetToStateMap(ids, "payload"),
+ handler_->OnIncomingInvalidation(ObjectIdSetToInvalidationMap(ids, "payload"),
syncer::REMOTE_INVALIDATION);
}
@@ -195,7 +195,7 @@ TEST_F(PushMessagingInvalidationHandlerTest, DispatchInvalidObjectIds) {
ids.insert(invalidation::ObjectId(
kSourceId,
"U/dddddddddddddddddddddddddddddddd/4"));
- handler_->OnIncomingInvalidation(ObjectIdSetToStateMap(ids, "payload"),
+ handler_->OnIncomingInvalidation(ObjectIdSetToInvalidationMap(ids, "payload"),
syncer::REMOTE_INVALIDATION);
}
diff --git a/chrome/browser/sync/glue/bridged_invalidator.cc b/chrome/browser/sync/glue/bridged_invalidator.cc
index 0146ad4..a0e1c2a 100644
--- a/chrome/browser/sync/glue/bridged_invalidator.cc
+++ b/chrome/browser/sync/glue/bridged_invalidator.cc
@@ -67,9 +67,9 @@ void BridgedInvalidator::UpdateCredentials(
}
void BridgedInvalidator::SendInvalidation(
- const syncer::ObjectIdStateMap& id_state_map) {
+ const syncer::ObjectIdInvalidationMap& invalidation_map) {
if (delegate_.get())
- delegate_->SendInvalidation(id_state_map);
+ delegate_->SendInvalidation(invalidation_map);
}
} // namespace browser_sync
diff --git a/chrome/browser/sync/glue/bridged_invalidator.h b/chrome/browser/sync/glue/bridged_invalidator.h
index 63d0ea4..b8c47ba 100644
--- a/chrome/browser/sync/glue/bridged_invalidator.h
+++ b/chrome/browser/sync/glue/bridged_invalidator.h
@@ -43,7 +43,7 @@ class BridgedInvalidator : public syncer::Invalidator {
virtual void UpdateCredentials(
const std::string& email, const std::string& token) OVERRIDE;
virtual void SendInvalidation(
- const syncer::ObjectIdStateMap& id_state_map) OVERRIDE;
+ const syncer::ObjectIdInvalidationMap& invalidation_map) OVERRIDE;
private:
// The notification bridge that we register the observers with.
diff --git a/chrome/browser/sync/glue/bridged_invalidator_unittest.cc b/chrome/browser/sync/glue/bridged_invalidator_unittest.cc
index ecd8084..966f387 100644
--- a/chrome/browser/sync/glue/bridged_invalidator_unittest.cc
+++ b/chrome/browser/sync/glue/bridged_invalidator_unittest.cc
@@ -19,7 +19,7 @@
#include "sync/notifier/fake_invalidation_handler.h"
#include "sync/notifier/fake_invalidator.h"
#include "sync/notifier/invalidator_test_template.h"
-#include "sync/notifier/object_id_state_map_test_util.h"
+#include "sync/notifier/object_id_invalidation_map_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -84,9 +84,9 @@ class BridgedInvalidatorTestDelegate {
}
void TriggerOnIncomingInvalidation(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource source) {
- fake_delegate_->EmitOnIncomingInvalidation(id_state_map, source);
+ fake_delegate_->EmitOnIncomingInvalidation(invalidation_map, source);
}
static bool InvalidatorHandlesDeprecatedState() {
@@ -170,11 +170,11 @@ TEST_F(BridgedInvalidatorTest, SendInvalidation) {
syncer::ObjectIdSet ids;
ids.insert(invalidation::ObjectId(1, "id1"));
ids.insert(invalidation::ObjectId(2, "id2"));
- const syncer::ObjectIdStateMap& id_state_map =
- syncer::ObjectIdSetToStateMap(ids, "payload");
- delegate_.GetInvalidator()->SendInvalidation(id_state_map);
- EXPECT_THAT(id_state_map,
- Eq(delegate_.GetFakeDelegate()->GetLastSentIdStateMap()));
+ const syncer::ObjectIdInvalidationMap& invalidation_map =
+ syncer::ObjectIdSetToInvalidationMap(ids, "payload");
+ delegate_.GetInvalidator()->SendInvalidation(invalidation_map);
+ EXPECT_THAT(invalidation_map,
+ Eq(delegate_.GetFakeDelegate()->GetLastSentInvalidationMap()));
}
} // namespace
diff --git a/chrome/browser/sync/glue/chrome_sync_notification_bridge.cc b/chrome/browser/sync/glue/chrome_sync_notification_bridge.cc
index 933cbc9..9b35858 100644
--- a/chrome/browser/sync/glue/chrome_sync_notification_bridge.cc
+++ b/chrome/browser/sync/glue/chrome_sync_notification_bridge.cc
@@ -37,7 +37,7 @@ class ChromeSyncNotificationBridge::Core
void UnregisterHandler(syncer::InvalidationHandler* handler);
void EmitInvalidation(
- const syncer::ObjectIdStateMap& state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource invalidation_source);
bool IsHandlerRegisteredForTest(syncer::InvalidationHandler* handler) const;
@@ -97,17 +97,17 @@ void ChromeSyncNotificationBridge::Core::UnregisterHandler(
}
void ChromeSyncNotificationBridge::Core::EmitInvalidation(
- const syncer::ObjectIdStateMap& state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource invalidation_source) {
DCHECK(sync_task_runner_->RunsTasksOnCurrentThread());
- const syncer::ObjectIdStateMap& effective_state_map =
- state_map.empty() ?
- ObjectIdSetToStateMap(
+ const syncer::ObjectIdInvalidationMap& effective_invalidation_map =
+ invalidation_map.empty() ?
+ ObjectIdSetToInvalidationMap(
invalidator_registrar_->GetAllRegisteredIds(), std::string()) :
- state_map;
+ invalidation_map;
invalidator_registrar_->DispatchInvalidationsToHandlers(
- effective_state_map, invalidation_source);
+ effective_invalidation_map, invalidation_source);
}
bool ChromeSyncNotificationBridge::Core::IsHandlerRegisteredForTest(
@@ -197,17 +197,19 @@ void ChromeSyncNotificationBridge::Observe(
return;
}
- // TODO(akalin): Use ObjectIdStateMap here instead. We'll have to
+ // TODO(akalin): Use ObjectIdInvalidationMap here instead. We'll have to
// make sure all emitters of the relevant notifications also use
- // ObjectIdStateMap.
- content::Details<const syncer::ModelTypeStateMap>
+ // ObjectIdInvalidationMap.
+ content::Details<const syncer::ModelTypeInvalidationMap>
state_details(details);
- const syncer::ModelTypeStateMap& state_map = *(state_details.ptr());
+ const syncer::ModelTypeInvalidationMap& invalidation_map =
+ *(state_details.ptr());
if (!sync_task_runner_->PostTask(
FROM_HERE,
base::Bind(&Core::EmitInvalidation,
core_,
- ModelTypeStateMapToObjectIdStateMap(state_map),
+ ModelTypeInvalidationMapToObjectIdInvalidationMap(
+ invalidation_map),
invalidation_source))) {
NOTREACHED();
}
diff --git a/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc b/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc
index 382e63c..1fabd18 100644
--- a/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc
+++ b/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc
@@ -22,9 +22,9 @@
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_browser_thread.h"
#include "sync/internal_api/public/base/model_type.h"
-#include "sync/internal_api/public/base/model_type_state_map.h"
+#include "sync/internal_api/public/base/model_type_invalidation_map.h"
#include "sync/notifier/fake_invalidation_handler.h"
-#include "sync/notifier/object_id_state_map_test_util.h"
+#include "sync/notifier/object_id_invalidation_map_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -68,14 +68,14 @@ class ChromeSyncNotificationBridgeTest : public testing::Test {
}
void VerifyAndDestroyObserver(
- const syncer::ModelTypeStateMap& expected_states,
+ const syncer::ModelTypeInvalidationMap& expected_invalidations,
syncer::IncomingInvalidationSource expected_source) {
ASSERT_TRUE(sync_thread_.message_loop_proxy()->PostTask(
FROM_HERE,
base::Bind(&ChromeSyncNotificationBridgeTest::
VerifyAndDestroyObserverOnSyncThread,
base::Unretained(this),
- expected_states,
+ expected_invalidations,
expected_source)));
BlockForSyncThread();
}
@@ -102,25 +102,27 @@ class ChromeSyncNotificationBridgeTest : public testing::Test {
void TriggerRefreshNotification(
int type,
- const syncer::ModelTypeStateMap& state_map) {
+ const syncer::ModelTypeInvalidationMap& invalidation_map) {
content::NotificationService::current()->Notify(
type,
content::Source<Profile>(&mock_profile_),
- content::Details<const syncer::ModelTypeStateMap>(&state_map));
+ content::Details<const syncer::ModelTypeInvalidationMap>(
+ &invalidation_map));
BlockForSyncThread();
}
private:
void VerifyAndDestroyObserverOnSyncThread(
- const syncer::ModelTypeStateMap& expected_states,
+ const syncer::ModelTypeInvalidationMap& expected_invalidations,
syncer::IncomingInvalidationSource expected_source) {
DCHECK(sync_thread_.message_loop_proxy()->RunsTasksOnCurrentThread());
if (sync_handler_.get()) {
sync_handler_notification_success_ =
(sync_handler_->GetInvalidationCount() == 1) &&
- ObjectIdStateMapEquals(
- sync_handler_->GetLastInvalidationIdStateMap(),
- syncer::ModelTypeStateMapToObjectIdStateMap(expected_states)) &&
+ ObjectIdInvalidationMapEquals(
+ sync_handler_->GetLastInvalidationMap(),
+ syncer::ModelTypeInvalidationMapToObjectIdInvalidationMap(
+ expected_invalidations)) &&
(sync_handler_->GetLastInvalidationSource() == expected_source);
bridge_->UnregisterHandler(sync_handler_.get());
} else {
@@ -167,28 +169,28 @@ class ChromeSyncNotificationBridgeTest : public testing::Test {
// invalidation, and ensures the bridge posts a LOCAL_INVALIDATION
// with the proper state to it.
TEST_F(ChromeSyncNotificationBridgeTest, LocalNotification) {
- syncer::ModelTypeStateMap state_map;
- state_map.insert(
- std::make_pair(syncer::SESSIONS, syncer::InvalidationState()));
+ const syncer::ModelTypeSet types(syncer::SESSIONS);
+ const syncer::ModelTypeInvalidationMap& invalidation_map =
+ ModelTypeSetToInvalidationMap(types, std::string());
CreateObserver();
UpdateEnabledTypes(syncer::ModelTypeSet(syncer::SESSIONS));
TriggerRefreshNotification(chrome::NOTIFICATION_SYNC_REFRESH_LOCAL,
- state_map);
- VerifyAndDestroyObserver(state_map, syncer::LOCAL_INVALIDATION);
+ invalidation_map);
+ VerifyAndDestroyObserver(invalidation_map, syncer::LOCAL_INVALIDATION);
}
// Adds an observer on the sync thread, triggers a remote refresh
// invalidation, and ensures the bridge posts a REMOTE_INVALIDATION
// with the proper state to it.
TEST_F(ChromeSyncNotificationBridgeTest, RemoteNotification) {
- syncer::ModelTypeStateMap state_map;
- state_map.insert(
- std::make_pair(syncer::SESSIONS, syncer::InvalidationState()));
+ const syncer::ModelTypeSet types(syncer::SESSIONS);
+ const syncer::ModelTypeInvalidationMap& invalidation_map =
+ ModelTypeSetToInvalidationMap(types, std::string());
CreateObserver();
UpdateEnabledTypes(syncer::ModelTypeSet(syncer::SESSIONS));
TriggerRefreshNotification(chrome::NOTIFICATION_SYNC_REFRESH_REMOTE,
- state_map);
- VerifyAndDestroyObserver(state_map, syncer::REMOTE_INVALIDATION);
+ invalidation_map);
+ VerifyAndDestroyObserver(invalidation_map, syncer::REMOTE_INVALIDATION);
}
// Adds an observer on the sync thread, triggers a local refresh
@@ -197,14 +199,14 @@ TEST_F(ChromeSyncNotificationBridgeTest, RemoteNotification) {
TEST_F(ChromeSyncNotificationBridgeTest, LocalNotificationEmptyPayloadMap) {
const syncer::ModelTypeSet enabled_types(
syncer::BOOKMARKS, syncer::PASSWORDS);
- const syncer::ModelTypeStateMap enabled_types_state_map =
- syncer::ModelTypeSetToStateMap(enabled_types, std::string());
+ const syncer::ModelTypeInvalidationMap enabled_types_invalidation_map =
+ syncer::ModelTypeSetToInvalidationMap(enabled_types, std::string());
CreateObserver();
UpdateEnabledTypes(enabled_types);
TriggerRefreshNotification(chrome::NOTIFICATION_SYNC_REFRESH_LOCAL,
- syncer::ModelTypeStateMap());
+ syncer::ModelTypeInvalidationMap());
VerifyAndDestroyObserver(
- enabled_types_state_map, syncer::LOCAL_INVALIDATION);
+ enabled_types_invalidation_map, syncer::LOCAL_INVALIDATION);
}
// Adds an observer on the sync thread, triggers a remote refresh
@@ -213,14 +215,14 @@ TEST_F(ChromeSyncNotificationBridgeTest, LocalNotificationEmptyPayloadMap) {
TEST_F(ChromeSyncNotificationBridgeTest, RemoteNotificationEmptyPayloadMap) {
const syncer::ModelTypeSet enabled_types(
syncer::BOOKMARKS, syncer::TYPED_URLS);
- const syncer::ModelTypeStateMap enabled_types_state_map =
- syncer::ModelTypeSetToStateMap(enabled_types, std::string());
+ const syncer::ModelTypeInvalidationMap enabled_types_invalidation_map =
+ syncer::ModelTypeSetToInvalidationMap(enabled_types, std::string());
CreateObserver();
UpdateEnabledTypes(enabled_types);
TriggerRefreshNotification(chrome::NOTIFICATION_SYNC_REFRESH_REMOTE,
- syncer::ModelTypeStateMap());
+ syncer::ModelTypeInvalidationMap());
VerifyAndDestroyObserver(
- enabled_types_state_map, syncer::REMOTE_INVALIDATION);
+ enabled_types_invalidation_map, syncer::REMOTE_INVALIDATION);
}
} // namespace
diff --git a/chrome/browser/sync/glue/session_change_processor.cc b/chrome/browser/sync/glue/session_change_processor.cc
index c95e21e..a79c5d1 100644
--- a/chrome/browser/sync/glue/session_change_processor.cc
+++ b/chrome/browser/sync/glue/session_change_processor.cc
@@ -24,7 +24,7 @@
#include "content/public/browser/web_contents.h"
#include "sync/api/sync_error.h"
#include "sync/internal_api/public/base/model_type.h"
-#include "sync/internal_api/public/base/model_type_state_map.h"
+#include "sync/internal_api/public/base/model_type_invalidation_map.h"
#include "sync/internal_api/public/change_record.h"
#include "sync/internal_api/public/read_node.h"
#include "sync/protocol/session_specifics.pb.h"
@@ -212,13 +212,14 @@ void SessionChangeProcessor::Observe(
entry->GetVirtualURL().is_valid() &&
entry->GetVirtualURL().spec() == kNTPOpenTabSyncURL) {
DVLOG(1) << "Triggering sync refresh for sessions datatype.";
- const syncer::ModelType type = syncer::SESSIONS;
- syncer::ModelTypeStateMap state_map;
- state_map.insert(std::make_pair(type, syncer::InvalidationState()));
+ const syncer::ModelTypeSet types(syncer::SESSIONS);
+ const syncer::ModelTypeInvalidationMap& invalidation_map =
+ ModelTypeSetToInvalidationMap(types, std::string());
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_SYNC_REFRESH_LOCAL,
content::Source<Profile>(profile_),
- content::Details<const syncer::ModelTypeStateMap>(&state_map));
+ content::Details<const syncer::ModelTypeInvalidationMap>(
+ &invalidation_map));
}
}
diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc
index cf37a0d..cbc143e9 100644
--- a/chrome/browser/sync/glue/session_model_associator.cc
+++ b/chrome/browser/sync/glue/session_model_associator.cc
@@ -32,7 +32,7 @@
#include "sync/api/sync_error.h"
#include "sync/api/time.h"
#include "sync/internal_api/public/base/model_type.h"
-#include "sync/internal_api/public/base/model_type_state_map.h"
+#include "sync/internal_api/public/base/model_type_invalidation_map.h"
#include "sync/internal_api/public/read_node.h"
#include "sync/internal_api/public/read_transaction.h"
#include "sync/internal_api/public/write_node.h"
@@ -1153,13 +1153,14 @@ void SessionModelAssociator::TabNodePool::FreeTabNode(int64 sync_id) {
void SessionModelAssociator::AttemptSessionsDataRefresh() const {
DVLOG(1) << "Triggering sync refresh for sessions datatype.";
- const syncer::ModelType type = syncer::SESSIONS;
- syncer::ModelTypeStateMap state_map;
- state_map.insert(std::make_pair(type, syncer::InvalidationState()));
+ const syncer::ModelTypeSet types(syncer::SESSIONS);
+ const syncer::ModelTypeInvalidationMap& invalidation_map =
+ ModelTypeSetToInvalidationMap(types, std::string());
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_SYNC_REFRESH_LOCAL,
content::Source<Profile>(profile_),
- content::Details<const syncer::ModelTypeStateMap>(&state_map));
+ content::Details<const syncer::ModelTypeInvalidationMap>(
+ &invalidation_map));
}
bool SessionModelAssociator::GetLocalSession(
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index e235cf7..76b1397 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -125,7 +125,7 @@ class SyncBackendHost::Core
virtual void OnInvalidatorStateChange(
syncer::InvalidatorState state) OVERRIDE;
virtual void OnIncomingInvalidation(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource source) OVERRIDE;
// Note:
@@ -1052,14 +1052,14 @@ void SyncBackendHost::Core::OnInvalidatorStateChange(
}
void SyncBackendHost::Core::OnIncomingInvalidation(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource source) {
if (!sync_loop_)
return;
DCHECK_EQ(MessageLoop::current(), sync_loop_);
host_.Call(FROM_HERE,
&SyncBackendHost::HandleIncomingInvalidationOnFrontendLoop,
- id_state_map, source);
+ invalidation_map, source);
}
void SyncBackendHost::Core::DoInitialize(const DoInitializeOptions& options) {
@@ -1444,12 +1444,12 @@ void SyncBackendHost::HandleInvalidatorStateChangeOnFrontendLoop(
}
void SyncBackendHost::HandleIncomingInvalidationOnFrontendLoop(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource source) {
if (!frontend_)
return;
DCHECK_EQ(MessageLoop::current(), frontend_loop_);
- frontend_->OnIncomingInvalidation(id_state_map, source);
+ frontend_->OnIncomingInvalidation(invalidation_map, source);
}
bool SyncBackendHost::CheckPassphraseAgainstCachedPendingKeys(
diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h
index 43730c9..5a237da 100644
--- a/chrome/browser/sync/glue/sync_backend_host.h
+++ b/chrome/browser/sync/glue/sync_backend_host.h
@@ -469,7 +469,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
void HandleInvalidatorStateChangeOnFrontendLoop(
syncer::InvalidatorState state);
void HandleIncomingInvalidationOnFrontendLoop(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource source);
// Handles stopping the core's SyncManager, accounting for whether
diff --git a/chrome/browser/sync/glue/sync_backend_host_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_unittest.cc
index d912d33..f28d88f 100644
--- a/chrome/browser/sync/glue/sync_backend_host_unittest.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_unittest.cc
@@ -24,7 +24,7 @@
#include "sync/internal_api/public/test/fake_sync_manager.h"
#include "sync/internal_api/public/util/experiments.h"
#include "sync/notifier/invalidator_state.h"
-#include "sync/notifier/object_id_state_map_test_util.h"
+#include "sync/notifier/object_id_invalidation_map_test_util.h"
#include "sync/protocol/encryption.pb.h"
#include "sync/protocol/sync_protocol_error.h"
#include "sync/util/test_unrecoverable_error_handler.h"
@@ -57,7 +57,7 @@ class MockSyncFrontend : public SyncFrontend {
MOCK_METHOD1(OnInvalidatorStateChange,
void(syncer::InvalidatorState));
MOCK_METHOD2(OnIncomingInvalidation,
- void(const syncer::ObjectIdStateMap&,
+ void(const syncer::ObjectIdInvalidationMap&,
syncer::IncomingInvalidationSource));
MOCK_METHOD2(OnBackendInitialized,
void(const syncer::WeakHandle<syncer::JsBackend>&, bool));
@@ -566,16 +566,16 @@ TEST_F(SyncBackendHostTest, Invalidate) {
syncer::ObjectIdSet ids;
ids.insert(invalidation::ObjectId(1, "id1"));
ids.insert(invalidation::ObjectId(2, "id2"));
- const syncer::ObjectIdStateMap& id_state_map =
- syncer::ObjectIdSetToStateMap(ids, "payload");
+ const syncer::ObjectIdInvalidationMap& invalidation_map =
+ syncer::ObjectIdSetToInvalidationMap(ids, "payload");
EXPECT_CALL(
mock_frontend_,
- OnIncomingInvalidation(id_state_map, syncer::REMOTE_INVALIDATION))
+ OnIncomingInvalidation(invalidation_map, syncer::REMOTE_INVALIDATION))
.WillOnce(InvokeWithoutArgs(QuitMessageLoop));
backend_->UpdateRegisteredInvalidationIds(ids);
- fake_manager_->Invalidate(id_state_map, syncer::REMOTE_INVALIDATION);
+ fake_manager_->Invalidate(invalidation_map, syncer::REMOTE_INVALIDATION);
ui_loop_.PostDelayedTask(
FROM_HERE, ui_loop_.QuitClosure(), TestTimeouts::action_timeout());
ui_loop_.Run();
@@ -614,9 +614,9 @@ TEST_F(SyncBackendHostTest, InvalidationsAfterStopSyncingForShutdown) {
// Should not trigger anything.
fake_manager_->UpdateInvalidatorState(syncer::TRANSIENT_INVALIDATION_ERROR);
fake_manager_->UpdateInvalidatorState(syncer::INVALIDATIONS_ENABLED);
- const syncer::ObjectIdStateMap& id_state_map =
- syncer::ObjectIdSetToStateMap(ids, "payload");
- fake_manager_->Invalidate(id_state_map, syncer::REMOTE_INVALIDATION);
+ const syncer::ObjectIdInvalidationMap& invalidation_map =
+ syncer::ObjectIdSetToInvalidationMap(ids, "payload");
+ fake_manager_->Invalidate(invalidation_map, syncer::REMOTE_INVALIDATION);
// Make sure the above calls take effect before we continue.
fake_manager_->WaitForSyncThread();
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 95f53af..4dc2b1b 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -479,9 +479,9 @@ void ProfileSyncService::EmitInvalidationForTest(
syncer::ObjectIdSet notify_ids;
notify_ids.insert(id);
- const syncer::ObjectIdStateMap& id_state_map =
- ObjectIdSetToStateMap(notify_ids, payload);
- OnIncomingInvalidation(id_state_map, syncer::REMOTE_INVALIDATION);
+ const syncer::ObjectIdInvalidationMap& invalidation_map =
+ ObjectIdSetToInvalidationMap(notify_ids, payload);
+ OnIncomingInvalidation(invalidation_map, syncer::REMOTE_INVALIDATION);
}
void ProfileSyncService::Shutdown() {
@@ -682,9 +682,10 @@ void ProfileSyncService::OnInvalidatorStateChange(
}
void ProfileSyncService::OnIncomingInvalidation(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource source) {
- invalidator_registrar_.DispatchInvalidationsToHandlers(id_state_map, source);
+ invalidator_registrar_.DispatchInvalidationsToHandlers(invalidation_map,
+ source);
}
void ProfileSyncService::OnBackendInitialized(
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index 17e9a63..4ab847b 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -269,7 +269,7 @@ class ProfileSyncService : public ProfileSyncServiceBase,
virtual void OnInvalidatorStateChange(
syncer::InvalidatorState state) OVERRIDE;
virtual void OnIncomingInvalidation(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource source) OVERRIDE;
// SyncFrontend implementation.
diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc
index 6eacdeb..788d425 100644
--- a/chrome/browser/sync/profile_sync_service_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_unittest.cc
@@ -30,7 +30,7 @@
#include "sync/notifier/fake_invalidation_handler.h"
#include "sync/notifier/invalidator.h"
#include "sync/notifier/invalidator_test_template.h"
-#include "sync/notifier/object_id_state_map_test_util.h"
+#include "sync/notifier/object_id_invalidation_map_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/user_agent/user_agent.h"
@@ -406,8 +406,8 @@ TEST_F(ProfileSyncServiceTest, UpdateRegisteredInvalidationIdsPersistence) {
syncer::ObjectIdSet ids;
ids.insert(invalidation::ObjectId(3, "id3"));
- const syncer::ObjectIdStateMap& states =
- syncer::ObjectIdSetToStateMap(ids, "payload");
+ const syncer::ObjectIdInvalidationMap& states =
+ syncer::ObjectIdSetToInvalidationMap(ids, "payload");
syncer::FakeInvalidationHandler handler;
@@ -424,7 +424,7 @@ TEST_F(ProfileSyncServiceTest, UpdateRegisteredInvalidationIdsPersistence) {
EXPECT_EQ(syncer::INVALIDATIONS_ENABLED, handler.GetInvalidatorState());
backend->EmitOnIncomingInvalidation(states, syncer::REMOTE_INVALIDATION);
- EXPECT_THAT(states, Eq(handler.GetLastInvalidationIdStateMap()));
+ EXPECT_THAT(states, Eq(handler.GetLastInvalidationMap()));
EXPECT_EQ(syncer::REMOTE_INVALIDATION, handler.GetLastInvalidationSource());
backend->EmitOnInvalidatorStateChange(syncer::TRANSIENT_INVALIDATION_ERROR);
@@ -473,7 +473,7 @@ class ProfileSyncServiceInvalidator : public syncer::Invalidator {
}
virtual void SendInvalidation(
- const syncer::ObjectIdStateMap& id_state_map) OVERRIDE {
+ const syncer::ObjectIdInvalidationMap& invalidation_map) OVERRIDE {
// Do nothing.
}
@@ -525,10 +525,10 @@ class ProfileSyncServiceInvalidatorTestDelegate {
}
void TriggerOnIncomingInvalidation(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource source) {
harness_.service->GetBackendForTest()->EmitOnIncomingInvalidation(
- id_state_map, source);
+ invalidation_map, source);
}
static bool InvalidatorHandlesDeprecatedState() {
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc
index 6fab4d3..d64411c 100644
--- a/chrome/browser/sync/test/integration/sync_test.cc
+++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -674,8 +674,8 @@ void SyncTest::TriggerNotification(syncer::ModelTypeSet changed_types) {
syncer::P2PNotificationData(
"from_server",
syncer::NOTIFY_ALL,
- syncer::ObjectIdSetToStateMap(
- syncer::ModelTypeSetToObjectIdSet(changed_types), ""),
+ syncer::ObjectIdSetToInvalidationMap(
+ syncer::ModelTypeSetToObjectIdSet(changed_types), std::string()),
syncer::REMOTE_INVALIDATION).ToString();
const std::string& path =
std::string("chromiumsync/sendnotification?channel=") +
diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc
index dd88ee9..ab926e7 100644
--- a/chrome/browser/sync/test_profile_sync_service.cc
+++ b/chrome/browser/sync/test_profile_sync_service.cc
@@ -152,9 +152,9 @@ void SyncBackendHostForProfileSyncTest::EmitOnInvalidatorStateChange(
}
void SyncBackendHostForProfileSyncTest::EmitOnIncomingInvalidation(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
const syncer::IncomingInvalidationSource source) {
- frontend()->OnIncomingInvalidation(id_state_map, source);
+ frontend()->OnIncomingInvalidation(invalidation_map, source);
}
} // namespace browser_sync
diff --git a/chrome/browser/sync/test_profile_sync_service.h b/chrome/browser/sync/test_profile_sync_service.h
index 7bd5fac..6b6059e 100644
--- a/chrome/browser/sync/test_profile_sync_service.h
+++ b/chrome/browser/sync/test_profile_sync_service.h
@@ -66,7 +66,7 @@ class SyncBackendHostForProfileSyncTest : public SyncBackendHost {
void EmitOnInvalidatorStateChange(syncer::InvalidatorState state);
void EmitOnIncomingInvalidation(
- const syncer::ObjectIdStateMap& id_state_map,
+ const syncer::ObjectIdInvalidationMap& invalidation_map,
const syncer::IncomingInvalidationSource source);
protected: