summaryrefslogtreecommitdiffstats
path: root/components/invalidation/ack_handler.h
blob: 0a2f642bb77e166a7e98a4990bae94c323081a46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2014 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.

#ifndef COMPONENTS_INVALIDATION_ACK_HANDLER_H_
#define COMPONENTS_INVALIDATION_ACK_HANDLER_H_

#include <vector>

#include "components/invalidation/invalidation_export.h"

namespace invalidation {
class ObjectId;
}  // namespace invalidation

namespace syncer {

class AckHandle;

// An interface for classes that keep track of invalidation acknowledgements.
//
// We don't expect to support more than one "real" implementation of AckHandler,
// but this interface is very useful for testing and implementation hiding.
class INVALIDATION_EXPORT AckHandler {
 public:
  AckHandler();
  virtual ~AckHandler() = 0;

  // Record the local acknowledgement of an invalidation identified by |handle|.
  virtual void Acknowledge(const invalidation::ObjectId& id,
                           const AckHandle& handle) = 0;

  // Record the drop of an invalidation identified by |handle|.
  virtual void Drop(const invalidation::ObjectId& id,
                    const AckHandle& handle) = 0;
};

}  // namespace syncer

#endif  // COMPONENTS_INVALIDATION_ACK_HANDLER_H_