| 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 COMPONENTS_SYNC_ENGINE_IMPL_COMMIT_PROCESSOR_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_COMMIT_PROCESSOR_H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_IMPL_COMMIT_PROCESSOR_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_COMMIT_PROCESSOR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "components/sync/base/model_type.h" | 14 #include "components/sync/base/model_type.h" |
| 15 #include "components/sync/base/sync_export.h" | |
| 16 #include "components/sync/engine/model_safe_worker.h" | 15 #include "components/sync/engine/model_safe_worker.h" |
| 17 #include "components/sync/engine_impl/commit.h" | 16 #include "components/sync/engine_impl/commit.h" |
| 18 #include "components/sync/sessions_impl/model_type_registry.h" | 17 #include "components/sync/sessions_impl/model_type_registry.h" |
| 19 | 18 |
| 20 namespace syncer { | 19 namespace syncer { |
| 21 | 20 |
| 22 namespace syncable { | 21 namespace syncable { |
| 23 class Directory; | 22 class Directory; |
| 24 } // namespace syncable | 23 } // namespace syncable |
| 25 | 24 |
| 26 class CommitContributor; | 25 class CommitContributor; |
| 27 class CommitContribution; | 26 class CommitContribution; |
| 28 | 27 |
| 29 // This class manages the set of per-type committer objects. | 28 // This class manages the set of per-type committer objects. |
| 30 // | 29 // |
| 31 // It owns these types and hides the details of iterating over all of them. | 30 // It owns these types and hides the details of iterating over all of them. |
| 32 // Many methods allow the caller to specify a subset of types on which the | 31 // Many methods allow the caller to specify a subset of types on which the |
| 33 // operation is to be applied. It is a logic error if the supplied set of types | 32 // operation is to be applied. It is a logic error if the supplied set of types |
| 34 // contains a type which was not previously registered. | 33 // contains a type which was not previously registered. |
| 35 class SYNC_EXPORT CommitProcessor { | 34 class CommitProcessor { |
| 36 public: | 35 public: |
| 37 // Contructs a CommitProcessor from a map of CommitContributors. | 36 // Contructs a CommitProcessor from a map of CommitContributors. |
| 38 // The CommitProcessor does not own this map. | 37 // The CommitProcessor does not own this map. |
| 39 explicit CommitProcessor(CommitContributorMap* commit_contributor_map); | 38 explicit CommitProcessor(CommitContributorMap* commit_contributor_map); |
| 40 ~CommitProcessor(); | 39 ~CommitProcessor(); |
| 41 | 40 |
| 42 // Gathers a set of contributions to be used to populate a commit message. | 41 // Gathers a set of contributions to be used to populate a commit message. |
| 43 // | 42 // |
| 44 // For each of the |commit_types| in this CommitProcessor's CommitContributor | 43 // For each of the |commit_types| in this CommitProcessor's CommitContributor |
| 45 // map, gather any entries queued for commit into CommitContributions. The | 44 // map, gather any entries queued for commit into CommitContributions. The |
| (...skipping 10 matching lines...) Expand all Loading... |
| 56 private: | 55 private: |
| 57 // A map of 'commit contributors', one for each enabled type. | 56 // A map of 'commit contributors', one for each enabled type. |
| 58 CommitContributorMap* commit_contributor_map_; | 57 CommitContributorMap* commit_contributor_map_; |
| 59 | 58 |
| 60 DISALLOW_COPY_AND_ASSIGN(CommitProcessor); | 59 DISALLOW_COPY_AND_ASSIGN(CommitProcessor); |
| 61 }; | 60 }; |
| 62 | 61 |
| 63 } // namespace syncer | 62 } // namespace syncer |
| 64 | 63 |
| 65 #endif // COMPONENTS_SYNC_ENGINE_IMPL_COMMIT_PROCESSOR_H_ | 64 #endif // COMPONENTS_SYNC_ENGINE_IMPL_COMMIT_PROCESSOR_H_ |
| OLD | NEW |