invalidation_adapter.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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.
  4. #ifndef COMPONENTS_SYNC_BASE_INVALIDATION_ADAPTER_H_
  5. #define COMPONENTS_SYNC_BASE_INVALIDATION_ADAPTER_H_
  6. #include <stdint.h>
  7. #include <string>
  8. #include "components/invalidation/public/invalidation.h"
  9. #include "components/sync/base/sync_invalidation.h"
  10. namespace syncer {
  11. // Wraps a Invalidation in the SyncInvalidation interface.
  12. class InvalidationAdapter : public SyncInvalidation {
  13. public:
  14. explicit InvalidationAdapter(const invalidation::Invalidation& invalidation);
  15. ~InvalidationAdapter() override;
  16. // Implementation of SyncInvalidation.
  17. bool IsUnknownVersion() const override;
  18. const std::string& GetPayload() const override;
  19. int64_t GetVersion() const override;
  20. void Acknowledge() override;
  21. void Drop() override;
  22. private:
  23. invalidation::Invalidation invalidation_;
  24. };
  25. } // namespace syncer
  26. #endif // COMPONENTS_SYNC_BASE_INVALIDATION_ADAPTER_H_