OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_SYNC_DRIVER_INVALIDATION_ADAPTER_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_INVALIDATION_ADAPTER_H_ |
6 #define COMPONENTS_SYNC_DRIVER_INVALIDATION_ADAPTER_H_ | 6 #define COMPONENTS_SYNC_DRIVER_INVALIDATION_ADAPTER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "components/invalidation/public/invalidation.h" | 12 #include "components/invalidation/public/invalidation.h" |
13 #include "components/sync/base/invalidation_interface.h" | 13 #include "components/sync/base/invalidation_interface.h" |
14 | 14 |
15 namespace browser_sync { | 15 namespace syncer { |
16 | 16 |
17 // Wraps a syncer::Invalidation in the syncer::InvalidationInterface. | 17 // Wraps a Invalidation in the InvalidationInterface. |
18 class InvalidationAdapter : public syncer::InvalidationInterface { | 18 class InvalidationAdapter : public InvalidationInterface { |
19 public: | 19 public: |
20 explicit InvalidationAdapter(const syncer::Invalidation& invalidation); | 20 explicit InvalidationAdapter(const Invalidation& invalidation); |
21 ~InvalidationAdapter() override; | 21 ~InvalidationAdapter() override; |
22 | 22 |
23 // Implementation of InvalidationInterface. | 23 // Implementation of InvalidationInterface. |
24 bool IsUnknownVersion() const override; | 24 bool IsUnknownVersion() const override; |
25 const std::string& GetPayload() const override; | 25 const std::string& GetPayload() const override; |
26 int64_t GetVersion() const override; | 26 int64_t GetVersion() const override; |
27 void Acknowledge() override; | 27 void Acknowledge() override; |
28 void Drop() override; | 28 void Drop() override; |
29 | 29 |
30 private: | 30 private: |
31 syncer::Invalidation invalidation_; | 31 Invalidation invalidation_; |
32 }; | 32 }; |
33 | 33 |
34 } // namespace browser_sync | 34 } // namespace syncer |
35 | 35 |
36 #endif // COMPONENTS_SYNC_DRIVER_INVALIDATION_ADAPTER_H_ | 36 #endif // COMPONENTS_SYNC_DRIVER_INVALIDATION_ADAPTER_H_ |
OLD | NEW |