Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / components / invalidation / fake_invalidation_state_tracker.h
blob1388badc10f5e82a65d57e5f680f121a731a5b62
1 // Copyright 2014 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 #ifndef COMPONENTS_INVALIDATION_FAKE_INVALIDATION_STATE_TRACKER_H_
6 #define COMPONENTS_INVALIDATION_FAKE_INVALIDATION_STATE_TRACKER_H_
8 #include "base/memory/weak_ptr.h"
9 #include "components/invalidation/invalidation_state_tracker.h"
11 namespace syncer {
13 // InvalidationStateTracker implementation that simply keeps track of
14 // the max versions and invalidation state in memory.
15 class FakeInvalidationStateTracker
16 : public InvalidationStateTracker,
17 public base::SupportsWeakPtr<FakeInvalidationStateTracker> {
18 public:
19 FakeInvalidationStateTracker();
20 ~FakeInvalidationStateTracker() override;
22 // InvalidationStateTracker implementation.
23 void ClearAndSetNewClientId(const std::string& client_id) override;
24 std::string GetInvalidatorClientId() const override;
25 void SetBootstrapData(const std::string& data) override;
26 std::string GetBootstrapData() const override;
27 void SetSavedInvalidations(const UnackedInvalidationsMap& states) override;
28 UnackedInvalidationsMap GetSavedInvalidations() const override;
29 void Clear() override;
31 static const int64 kMinVersion;
33 private:
34 std::string invalidator_client_id_;
35 std::string bootstrap_data_;
36 UnackedInvalidationsMap unacked_invalidations_map_;
39 } // namespace syncer
41 #endif // COMPONENTS_INVALIDATION_FAKE_INVALIDATION_STATE_TRACKER_H_