summaryrefslogtreecommitdiffstats
path: root/sync/engine/commit_contributor.h
blob: 8b89a12467c21e8984cfe48e2c8375e63a4a15fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SYNC_ENGINE_COMMIT_CONTRIBUTOR_H_
#define SYNC_ENGINE_COMMIT_CONTRIBUTOR_H_

#include <cstddef>

#include "base/memory/scoped_ptr.h"
#include "sync/base/sync_export.h"

namespace syncer {

class CommitContribution;

namespace syncable {
class Directory;
}

// This class represents a source of items to commit to the sync server.
//
// When asked, it can return CommitContribution objects that contain a set of
// items to be committed from this source.
class SYNC_EXPORT CommitContributor {
 public:
  CommitContributor();
  virtual ~CommitContributor() = 0;

  // Gathers up to |max_entries| unsynced items from this contributor into a
  // CommitContribution.  Returns NULL when the contributor has nothing to
  // contribute.
  virtual scoped_ptr<CommitContribution> GetContribution(
      size_t max_entries) = 0;
};

}  // namespace syncer

#endif  // SYNC_ENGINE_COMMIT_CONTRIBUTOR_H_