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

Unified Diff: sync/sessions/nudge_tracker.cc

Issue 23238005: sync: Remove ModelTypeInvalidationMap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sort entries in gyp files Created 7 years, 4 months 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
« no previous file with comments | « sync/sessions/nudge_tracker.h ('k') | sync/sessions/nudge_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/nudge_tracker.cc
diff --git a/sync/sessions/nudge_tracker.cc b/sync/sessions/nudge_tracker.cc
index 9587f394a45087a0d8f58ee887c3ea6b4c3870d3..8ec8970ef36b1a3c82a36b4cfc33c689218e64ec 100644
--- a/sync/sessions/nudge_tracker.cc
+++ b/sync/sessions/nudge_tracker.cc
@@ -6,6 +6,8 @@
#include "base/basictypes.h"
#include "sync/internal_api/public/base/invalidation.h"
+#include "sync/notifier/invalidation_util.h"
+#include "sync/notifier/object_id_invalidation_map.h"
#include "sync/protocol/sync.pb.h"
namespace syncer {
@@ -91,15 +93,19 @@ void NudgeTracker::RecordLocalRefreshRequest(ModelTypeSet types) {
}
void NudgeTracker::RecordRemoteInvalidation(
- const ModelTypeInvalidationMap& invalidation_map) {
+ const ObjectIdInvalidationMap& invalidation_map) {
updates_source_ = sync_pb::GetUpdatesCallerInfo::NOTIFICATION;
- for (ModelTypeInvalidationMap::const_iterator i = invalidation_map.begin();
- i != invalidation_map.end(); ++i) {
- const ModelType type = i->first;
- const std::string& payload = i->second.payload;
+ for (ObjectIdInvalidationMap::const_iterator it = invalidation_map.begin();
+ it != invalidation_map.end(); ++it) {
+ ModelType type;
+ if (!ObjectIdToRealModelType(it->first, &type)) {
+ NOTREACHED()
+ << "Object ID " << ObjectIdToString(it->first)
+ << " does not map to valid model type";
+ }
DCHECK(type_trackers_.find(type) != type_trackers_.end());
- type_trackers_[type].RecordRemoteInvalidation(payload);
+ type_trackers_[type].RecordRemoteInvalidation(it->second.payload);
}
}
« no previous file with comments | « sync/sessions/nudge_tracker.h ('k') | sync/sessions/nudge_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698