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

Unified Diff: chrome/browser/drive/drive_notification_manager.cc

Issue 23754021: Invalidation trickles mega-patch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | chrome/browser/extensions/api/push_messaging/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/drive/drive_notification_manager.cc
diff --git a/chrome/browser/drive/drive_notification_manager.cc b/chrome/browser/drive/drive_notification_manager.cc
index 198c0148ecb35690202e1c99743bd46bd230c328..9d1788250a495645d125f9d4b1aa2acc66018190 100644
--- a/chrome/browser/drive/drive_notification_manager.cc
+++ b/chrome/browser/drive/drive_notification_manager.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/invalidation/invalidation_service.h"
#include "chrome/browser/invalidation/invalidation_service_factory.h"
#include "google/cacheinvalidation/types.pb.h"
+#include "sync/notifier/object_id_invalidation_map.h"
namespace drive {
@@ -68,19 +69,15 @@ void DriveNotificationManager::OnInvalidatorStateChange(
void DriveNotificationManager::OnIncomingInvalidation(
const syncer::ObjectIdInvalidationMap& invalidation_map) {
DVLOG(2) << "XMPP Drive Notification Received";
- DCHECK_EQ(1U, invalidation_map.size());
+ syncer::ObjectIdSet ids = invalidation_map.GetObjectIds();
+ DCHECK_EQ(1U, ids.size());
const invalidation::ObjectId object_id(
ipc::invalidation::ObjectSource::COSMO_CHANGELOG,
kDriveInvalidationObjectId);
- DCHECK_EQ(1U, invalidation_map.count(object_id));
-
- // TODO(dcheng): Only acknowledge the invalidation once the fetch has
- // completed. http://crbug.com/156843
- DCHECK(invalidation_service_);
- invalidation_service_->AcknowledgeInvalidation(
- invalidation_map.begin()->first,
- invalidation_map.begin()->second.ack_handle);
+ DCHECK_EQ(1U, ids.count(object_id));
+ // TODO: Acknowledge only after fetch completes.
+ invalidation_map.AcknowledgeAll();
NotifyObserversToUpdate(NOTIFICATION_XMPP);
}
« no previous file with comments | « no previous file | chrome/browser/extensions/api/push_messaging/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698