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

Unified Diff: chrome/browser/sync/notifier/chrome_invalidation_client.cc

Issue 8772074: [Sync] Convert syncable/ directory to ModelEnumSet (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 9 years 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: chrome/browser/sync/notifier/chrome_invalidation_client.cc
diff --git a/chrome/browser/sync/notifier/chrome_invalidation_client.cc b/chrome/browser/sync/notifier/chrome_invalidation_client.cc
index f770550f1d02d51e1ea7a0efc9651899087cb812..2aa072b75c3e52ba841f797820b547a7aa53e876 100644
--- a/chrome/browser/sync/notifier/chrome_invalidation_client.cc
+++ b/chrome/browser/sync/notifier/chrome_invalidation_client.cc
@@ -129,8 +129,7 @@ void ChromeInvalidationClient::Stop() {
max_invalidation_versions_.clear();
}
-void ChromeInvalidationClient::RegisterTypes(
- const syncable::ModelTypeSet& types) {
+void ChromeInvalidationClient::RegisterTypes(syncable::ModelEnumSet types) {
DCHECK(non_thread_safe_.CalledOnValidThread());
registered_types_ = types;
if (ticl_ready_ && registration_manager_.get()) {
@@ -190,9 +189,7 @@ void ChromeInvalidationClient::Invalidate(
if (invalidation.has_payload())
payload = invalidation.payload();
- syncable::ModelTypeSet types;
- types.insert(model_type);
- EmitInvalidation(types, payload);
+ EmitInvalidation(syncable::ModelEnumSet(model_type), payload);
// TODO(akalin): We should really acknowledge only after we get the
// updates from the sync server. (see http://crbug.com/78462).
client->Acknowledge(ack_handle);
@@ -214,9 +211,7 @@ void ChromeInvalidationClient::InvalidateUnknownVersion(
return;
}
- syncable::ModelTypeSet types;
- types.insert(model_type);
- EmitInvalidation(types, "");
+ EmitInvalidation(syncable::ModelEnumSet(model_type), "");
// TODO(akalin): We should really acknowledge only after we get the
// updates from the sync server. (see http://crbug.com/78462).
client->Acknowledge(ack_handle);
@@ -236,13 +231,10 @@ void ChromeInvalidationClient::InvalidateAll(
}
void ChromeInvalidationClient::EmitInvalidation(
- const syncable::ModelTypeSet& types, const std::string& payload) {
+ syncable::ModelEnumSet types, const std::string& payload) {
DCHECK(non_thread_safe_.CalledOnValidThread());
- // TODO(akalin): Move all uses of ModelTypeBitSet for invalidations
- // to ModelTypeSet.
syncable::ModelTypePayloadMap type_payloads =
- syncable::ModelTypePayloadMapFromBitSet(
- syncable::ModelTypeBitSetFromSet(types), payload);
+ syncable::ModelTypePayloadMapFromEnumSet(types, payload);
listener_->OnInvalidate(type_payloads);
}

Powered by Google App Engine
This is Rietveld 408576698