OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_COMMIT_PROCESSOR_H_ | 5 #ifndef SYNC_ENGINE_COMMIT_PROCESSOR_H_ |
6 #define SYNC_ENGINE_COMMIT_PROCESSOR_H_ | 6 #define SYNC_ENGINE_COMMIT_PROCESSOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "sync/base/sync_export.h" | 12 #include "sync/base/sync_export.h" |
13 #include "sync/internal_api/public/base/model_type.h" | 13 #include "sync/internal_api/public/base/model_type.h" |
14 #include "sync/internal_api/public/engine/model_safe_worker.h" | 14 #include "sync/internal_api/public/engine/model_safe_worker.h" |
15 #include "sync/sessions/model_type_registry.h" | 15 #include "sync/sessions/model_type_registry.h" |
16 | 16 |
17 namespace syncer { | 17 namespace syncer { |
18 | 18 |
19 namespace syncable { | 19 namespace syncable { |
20 class Directory; | 20 class Directory; |
21 } // namespace syncable | 21 } // namespace syncable |
22 | 22 |
23 class SyncDirectoryCommitContributor; | 23 class CommitContributor; |
24 class SyncDirectoryCommitContribution; | 24 class CommitContribution; |
25 | 25 |
26 // This class manages the set of per-type committer objects. | 26 // This class manages the set of per-type committer objects. |
27 // | 27 // |
28 // It owns these types and hides the details of iterating over all of them. | 28 // It owns these types and hides the details of iterating over all of them. |
29 // Many methods allow the caller to specify a subset of types on which the | 29 // Many methods allow the caller to specify a subset of types on which the |
30 // operation is to be applied. It is a logic error if the supplied set of types | 30 // operation is to be applied. It is a logic error if the supplied set of types |
31 // contains a type which was not previously registered. | 31 // contains a type which was not previously registered. |
32 class SYNC_EXPORT_PRIVATE CommitProcessor { | 32 class SYNC_EXPORT_PRIVATE CommitProcessor { |
33 public: | 33 public: |
34 typedef std::map<ModelType, SyncDirectoryCommitContribution*> ContributionMap; | 34 typedef std::map<ModelType, CommitContribution*> ContributionMap; |
35 | 35 |
36 explicit CommitProcessor(CommitContributorMap* commit_contributor_map); | 36 explicit CommitProcessor(CommitContributorMap* commit_contributor_map); |
tim (not reviewing)
2014/02/18 19:15:01
Comment on parameter (at least ownership / lifetim
rlarocque
2014/02/18 20:01:13
Done.
| |
37 ~CommitProcessor(); | 37 ~CommitProcessor(); |
38 | 38 |
39 // Gathers a set of contributions to be used to populate a commit message. | 39 // Gathers a set of contributions to be used to populate a commit message. |
tim (not reviewing)
2014/02/18 19:15:01
Explaining the parameters would help (e.g does |ma
rlarocque
2014/02/18 20:01:13
Done.
| |
40 void GatherCommitContributions( | 40 void GatherCommitContributions( |
41 ModelTypeSet commit_types, | 41 ModelTypeSet commit_types, |
42 size_t max_entries, | 42 size_t max_entries, |
43 ContributionMap* contributions); | 43 ContributionMap* contributions); |
44 | 44 |
45 private: | 45 private: |
46 // A map of 'commit contributors', one for each enabled type. | 46 // A map of 'commit contributors', one for each enabled type. |
47 CommitContributorMap* commit_contributor_map_; | 47 CommitContributorMap* commit_contributor_map_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(CommitProcessor); | 49 DISALLOW_COPY_AND_ASSIGN(CommitProcessor); |
50 }; | 50 }; |
51 | 51 |
52 } // namespace syncer | 52 } // namespace syncer |
53 | 53 |
54 #endif // SYNC_ENGINE_COMMIT_PROCESSOR_H_ | 54 #endif // SYNC_ENGINE_COMMIT_PROCESSOR_H_ |
OLD | NEW |