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"
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
> {
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
;
34 std::string invalidator_client_id_
;
35 std::string bootstrap_data_
;
36 UnackedInvalidationsMap unacked_invalidations_map_
;
41 #endif // COMPONENTS_INVALIDATION_FAKE_INVALIDATION_STATE_TRACKER_H_