Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: sync/engine/directory_commit_contributor.h

Issue 161253002: sync: Add interfaces for per-type sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor fix Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 SYNC_ENGINE_SYNC_DIRECTORY_COMMIT_CONTRIBUTOR_H_ 5 #ifndef SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTOR_H_
6 #define SYNC_ENGINE_SYNC_DIRECTORY_COMMIT_CONTRIBUTOR_H_ 6 #define SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTOR_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "sync/engine/commit_contributor.h"
11 #include "sync/engine/directory_commit_contribution.h"
10 #include "sync/internal_api/public/base/model_type.h" 12 #include "sync/internal_api/public/base/model_type.h"
11 13
12 namespace syncer { 14 namespace syncer {
13 15
14 class SyncDirectoryCommitContribution;
15
16 namespace syncable { 16 namespace syncable {
17 class Directory; 17 class Directory;
18 } 18 }
19 19
20 // This class represents the syncable::Directory as a source of items to commit 20 // This class represents the syncable::Directory as a source of items to commit
21 // to the sync server. 21 // to the sync server.
22 // 22 //
23 // Each instance of this class represents a particular type within the 23 // Each instance of this class represents a particular type within the
24 // syncable::Directory. When asked, it will iterate through the directory, grab 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 25 // any items of its type that are ready for commit, and return them in the form
26 // of a SyncDirectoryCommitContribution. 26 // of a DirectoryCommitContribution.
27 class SyncDirectoryCommitContributor { 27 class DirectoryCommitContributor : public CommitContributor {
28 public: 28 public:
29 SyncDirectoryCommitContributor(syncable::Directory* dir, ModelType type); 29 DirectoryCommitContributor(syncable::Directory* dir, ModelType type);
30 ~SyncDirectoryCommitContributor(); 30 virtual ~DirectoryCommitContributor() OVERRIDE;
31 31
32 SyncDirectoryCommitContribution* GetContribution(size_t max_entries); 32 virtual DirectoryCommitContribution* GetContribution(
33 size_t max_entries) OVERRIDE;
33 34
34 private: 35 private:
35 syncable::Directory* dir_; 36 syncable::Directory* dir_;
36 ModelType type_; 37 ModelType type_;
tim (not reviewing) 2014/02/18 19:15:01 DISALLOW_COPY_AND_ASSIGN?
rlarocque 2014/02/18 20:01:13 Done.
37 }; 38 };
38 39
39 } // namespace 40 } // namespace
40 41
41 #endif // SYNC_ENGINE_SYNC_DIRECTORY_COMMIT_CONTRIBUTOR_H_ 42 #endif // SYNC_ENGINE_DIRECTORY_COMMIT_CONTRIBUTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698