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

Unified Diff: sync/notifier/dropped_invalidation_tracker.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 | « sync/notifier/dropped_invalidation_tracker.h ('k') | sync/notifier/fake_invalidation_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/dropped_invalidation_tracker.cc
diff --git a/sync/notifier/dropped_invalidation_tracker.cc b/sync/notifier/dropped_invalidation_tracker.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fa5264315b5f315bf18b181ed1b97545451f6f40
--- /dev/null
+++ b/sync/notifier/dropped_invalidation_tracker.cc
@@ -0,0 +1,47 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "sync/notifier/dropped_invalidation_tracker.h"
+
+#include "sync/internal_api/public/base/invalidation.h"
+
+namespace syncer {
+
+DroppedInvalidationTracker::DroppedInvalidationTracker(
+ const invalidation::ObjectId& id)
+ : id_(id),
+ drop_ack_handle_(AckHandle::InvalidAckHandle()) {}
+
+DroppedInvalidationTracker::~DroppedInvalidationTracker() {}
+
+const invalidation::ObjectId& DroppedInvalidationTracker::GetObjectId() const {
+ return id_;
+}
+
+void DroppedInvalidationTracker::Drop(
+ WeakHandle<AckHandler> handler, AckHandle handle) {
+ drop_ack_handler_ = handler;
+ drop_ack_handle_ = handle;
+
+ drop_ack_handler_.Call(FROM_HERE,
+ &AckHandler::Drop,
+ id_,
+ drop_ack_handle_);
+}
+
+void DroppedInvalidationTracker::RecoverFromDropEvent() {
+ if (drop_ack_handler_.IsInitialized()) {
+ drop_ack_handler_.Call(FROM_HERE,
+ &AckHandler::Acknowledge,
+ id_,
+ drop_ack_handle_);
+ }
+ drop_ack_handler_ = syncer::WeakHandle<AckHandler>();
+}
+
+bool DroppedInvalidationTracker::IsRecoveringFromDropEvent() const {
+ return drop_ack_handler_.IsInitialized();
+}
+
+} // namespace syncer
« no previous file with comments | « sync/notifier/dropped_invalidation_tracker.h ('k') | sync/notifier/fake_invalidation_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698