Get foreground tab on Android
[chromium-blink-merge.git] / sync / notifier / dropped_invalidation_tracker.cc
blob8599cc258c0c9e8c0583baf812481225f53ebd52
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.
5 #include "sync/notifier/dropped_invalidation_tracker.h"
7 #include "sync/internal_api/public/base/invalidation.h"
9 namespace syncer {
11 DroppedInvalidationTracker::DroppedInvalidationTracker(
12 const invalidation::ObjectId& id)
13 : id_(id),
14 drop_ack_handle_(AckHandle::InvalidAckHandle()) {}
16 DroppedInvalidationTracker::~DroppedInvalidationTracker() {}
18 const invalidation::ObjectId& DroppedInvalidationTracker::object_id() const {
19 return id_;
22 void DroppedInvalidationTracker::RecordDropEvent(
23 WeakHandle<AckHandler> handler, AckHandle handle) {
24 drop_ack_handler_ = handler;
25 drop_ack_handle_ = handle;
28 void DroppedInvalidationTracker::RecordRecoveryFromDropEvent() {
29 if (drop_ack_handler_.IsInitialized()) {
30 drop_ack_handler_.Call(FROM_HERE,
31 &AckHandler::Acknowledge,
32 id_,
33 drop_ack_handle_);
35 drop_ack_handler_ = syncer::WeakHandle<AckHandler>();
38 bool DroppedInvalidationTracker::IsRecoveringFromDropEvent() const {
39 return drop_ack_handler_.IsInitialized();
42 } // namespace syncer