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

Unified Diff: chrome/browser/invalidation/invalidation_logger.cc

Issue 159773006: [invalidations] Added table with registered objectsIds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@about_invalidations_clean
Patch Set: Removed a redefinition of GetOwnerName Created 6 years, 10 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
Index: chrome/browser/invalidation/invalidation_logger.cc
diff --git a/chrome/browser/invalidation/invalidation_logger.cc b/chrome/browser/invalidation/invalidation_logger.cc
index 19bdf9d2464409600d139744fe6d3b5bc7336797..73adbc67946660f7f415b4277c21e058390723bd 100644
--- a/chrome/browser/invalidation/invalidation_logger.cc
+++ b/chrome/browser/invalidation/invalidation_logger.cc
@@ -7,6 +7,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "chrome/browser/invalidation/invalidation_logger_observer.h"
+#include "sync/notifier/invalidation_handler.h"
namespace syncer {
class ObjectIdInvalidationMap;
@@ -43,9 +44,26 @@ void InvalidationLogger::EmitState() {
OnStateChange(last_invalidator_state_));
}
-void InvalidationLogger::OnUpdateIds(const base::DictionaryValue& details) {
- FOR_EACH_OBSERVER(
- InvalidationLoggerObserver, observer_list_, OnUpdateIds(details));
+void InvalidationLogger::OnUpdateIds(
+ std::map<std::string, syncer::ObjectIdSet> updatedIds) {
+ for (std::map<std::string, syncer::ObjectIdSet>::iterator it =
+ updatedIds.begin();
+ it != updatedIds.end();
+ ++it) {
+ latest_ids_[it->first] = syncer::ObjectIdSet(it->second);
+ }
+ EmitUpdatedIds();
+}
+
+void InvalidationLogger::EmitUpdatedIds() {
+ for (std::map<std::string, syncer::ObjectIdSet>::iterator it =
+ latest_ids_.begin();
+ it != latest_ids_.end();
+ ++it) {
+ FOR_EACH_OBSERVER(InvalidationLoggerObserver,
+ observer_list_,
+ OnUpdateIds(it->first, it->second));
+ }
}
void InvalidationLogger::OnDebugMessage(const base::DictionaryValue& details) {
@@ -63,6 +81,7 @@ void InvalidationLogger::EmitContent() {
// Here we add content to send to the observers not via real time push
// but on explicit request.
EmitState();
+ EmitUpdatedIds();
}
// Obtain a target object to call whenever we have

Powered by Google App Engine
This is Rietveld 408576698