commit_contributor.h 1013 B

123456789101112131415161718192021222324252627282930313233
  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_ENGINE_COMMIT_CONTRIBUTOR_H_
  5. #define COMPONENTS_SYNC_ENGINE_COMMIT_CONTRIBUTOR_H_
  6. #include <cstddef>
  7. #include <memory>
  8. namespace syncer {
  9. class CommitContribution;
  10. // This class represents a source of items to commit to the sync server.
  11. //
  12. // When asked, it can return CommitContribution objects that contain a set of
  13. // items to be committed from this source.
  14. class CommitContributor {
  15. public:
  16. CommitContributor() = default;
  17. virtual ~CommitContributor() = default;
  18. // Gathers up to |max_entries| unsynced items from this contributor into a
  19. // CommitContribution. Returns null when the contributor has nothing to
  20. // contribute.
  21. virtual std::unique_ptr<CommitContribution> GetContribution(
  22. size_t max_entries) = 0;
  23. };
  24. } // namespace syncer
  25. #endif // COMPONENTS_SYNC_ENGINE_COMMIT_CONTRIBUTOR_H_