| 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 <string> |
| 9 |
| 8 #include "components/invalidation/public/invalidation.h" | 10 #include "components/invalidation/public/invalidation.h" |
| 9 #include "sync/internal_api/public/base/invalidation_interface.h" | 11 #include "sync/internal_api/public/base/invalidation_interface.h" |
| 10 | 12 |
| 11 namespace browser_sync { | 13 namespace browser_sync { |
| 12 | 14 |
| 13 // Wraps a syncer::Invalidation in the syncer::InvalidationInterface. | 15 // Wraps a syncer::Invalidation in the syncer::InvalidationInterface. |
| 14 class InvalidationAdapter : public syncer::InvalidationInterface { | 16 class InvalidationAdapter : public syncer::InvalidationInterface { |
| 15 public: | 17 public: |
| 16 explicit InvalidationAdapter(const syncer::Invalidation& invalidation); | 18 explicit InvalidationAdapter(const syncer::Invalidation& invalidation); |
| 17 ~InvalidationAdapter() override; | 19 ~InvalidationAdapter() override; |
| 18 | 20 |
| 19 // Implementation of InvalidationInterface. | 21 // Implementation of InvalidationInterface. |
| 20 bool IsUnknownVersion() const override; | 22 bool IsUnknownVersion() const override; |
| 21 const std::string& GetPayload() const override; | 23 const std::string& GetPayload() const override; |
| 22 int64 GetVersion() const override; | 24 int64 GetVersion() const override; |
| 23 void Acknowledge() override; | 25 void Acknowledge() override; |
| 24 void Drop() override; | 26 void Drop() override; |
| 25 | 27 |
| 26 private: | 28 private: |
| 27 syncer::Invalidation invalidation_; | 29 syncer::Invalidation invalidation_; |
| 28 }; | 30 }; |
| 29 | 31 |
| 30 } // namespace browser_sync | 32 } // namespace browser_sync |
| 31 | 33 |
| 32 #endif // COMPONENTS_SYNC_DRIVER_INVALIDATION_ADAPTER_H_ | 34 #endif // COMPONENTS_SYNC_DRIVER_INVALIDATION_ADAPTER_H_ |
| OLD | NEW |