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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/notifier/dropped_invalidation_tracker.h ('k') | sync/notifier/fake_invalidation_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "sync/notifier/dropped_invalidation_tracker.h"
6
7 #include "sync/internal_api/public/base/invalidation.h"
8
9 namespace syncer {
10
11 DroppedInvalidationTracker::DroppedInvalidationTracker(
12 const invalidation::ObjectId& id)
13 : id_(id),
14 drop_ack_handle_(AckHandle::InvalidAckHandle()) {}
15
16 DroppedInvalidationTracker::~DroppedInvalidationTracker() {}
17
18 const invalidation::ObjectId& DroppedInvalidationTracker::GetObjectId() const {
19 return id_;
20 }
21
22 void DroppedInvalidationTracker::Drop(
23 WeakHandle<AckHandler> handler, AckHandle handle) {
24 drop_ack_handler_ = handler;
25 drop_ack_handle_ = handle;
26
27 drop_ack_handler_.Call(FROM_HERE,
28 &AckHandler::Drop,
29 id_,
30 drop_ack_handle_);
31 }
32
33 void DroppedInvalidationTracker::RecoverFromDropEvent() {
34 if (drop_ack_handler_.IsInitialized()) {
35 drop_ack_handler_.Call(FROM_HERE,
36 &AckHandler::Acknowledge,
37 id_,
38 drop_ack_handle_);
39 }
40 drop_ack_handler_ = syncer::WeakHandle<AckHandler>();
41 }
42
43 bool DroppedInvalidationTracker::IsRecoveringFromDropEvent() const {
44 return drop_ack_handler_.IsInitialized();
45 }
46
47 } // namespace syncer
OLDNEW
« 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