Refactor management of overview window copy lifetime into a separate class.
[chromium-blink-merge.git] / sync / engine / sync_directory_commit_contributor.h
blob6ffaeb7761ac6dba3b02bd42877dfe3352c4fdb8
1 // Copyright 2013 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.
5 #ifndef SYNC_ENGINE_SYNC_DIRECTORY_COMMIT_CONTRIBUTOR_H_
6 #define SYNC_ENGINE_SYNC_DIRECTORY_COMMIT_CONTRIBUTOR_H_
8 #include <map>
10 #include "sync/internal_api/public/base/model_type.h"
12 namespace syncer {
14 class SyncDirectoryCommitContribution;
16 namespace syncable {
17 class Directory;
20 // This class represents the syncable::Directory as a source of items to commit
21 // to the sync server.
23 // Each instance of this class represents a particular type within the
24 // syncable::Directory. When asked, it will iterate through the directory, grab
25 // any items of its type that are ready for commit, and return them in the form
26 // of a SyncDirectoryCommitContribution.
27 class SyncDirectoryCommitContributor {
28 public:
29 SyncDirectoryCommitContributor(syncable::Directory* dir, ModelType type);
30 ~SyncDirectoryCommitContributor();
32 SyncDirectoryCommitContribution* GetContribution(size_t max_entries);
34 private:
35 syncable::Directory* dir_;
36 ModelType type_;
39 // TODO(rlarocque): Find a better place for this definition.
40 typedef std::map<ModelType, SyncDirectoryCommitContributor*>
41 CommitContributorMap;
43 } // namespace
45 #endif // SYNC_ENGINE_SYNC_DIRECTORY_COMMIT_CONTRIBUTOR_H_