| 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_DIRECTORY_COMMIT_CONTRIBUTOR_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_DIRECTORY_COMMIT_CONTRIBUTOR_H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_IMPL_DIRECTORY_COMMIT_CONTRIBUTOR_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_DIRECTORY_COMMIT_CONTRIBUTOR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 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/engine_impl/commit_contributor.h" | 15 #include "components/sync/engine_impl/commit_contributor.h" |
| 16 #include "components/sync/engine_impl/directory_commit_contribution.h" | 16 #include "components/sync/engine_impl/directory_commit_contribution.h" |
| 17 | 17 |
| 18 namespace syncer { | 18 namespace syncer { |
| 19 | 19 |
| 20 namespace syncable { | 20 namespace syncable { |
| 21 class Directory; | 21 class Directory; |
| 22 } | 22 } |
| 23 | 23 |
| 24 class DirectoryTypeDebugInfoEmitter; | 24 class DataTypeDebugInfoEmitter; |
| 25 | 25 |
| 26 // This class represents the syncable::Directory as a source of items to commit | 26 // This class represents the syncable::Directory as a source of items to commit |
| 27 // to the sync server. | 27 // to the sync server. |
| 28 // | 28 // |
| 29 // Each instance of this class represents a particular type within the | 29 // Each instance of this class represents a particular type within the |
| 30 // syncable::Directory. When asked, it will iterate through the directory, grab | 30 // syncable::Directory. When asked, it will iterate through the directory, grab |
| 31 // any items of its type that are ready for commit, and return them in the form | 31 // any items of its type that are ready for commit, and return them in the form |
| 32 // of a DirectoryCommitContribution. | 32 // of a DirectoryCommitContribution. |
| 33 class DirectoryCommitContributor : public CommitContributor { | 33 class DirectoryCommitContributor : public CommitContributor { |
| 34 public: | 34 public: |
| 35 DirectoryCommitContributor(syncable::Directory* dir, | 35 DirectoryCommitContributor(syncable::Directory* dir, |
| 36 ModelType type, | 36 ModelType type, |
| 37 DirectoryTypeDebugInfoEmitter* debug_info_emitter); | 37 DataTypeDebugInfoEmitter* debug_info_emitter); |
| 38 ~DirectoryCommitContributor() override; | 38 ~DirectoryCommitContributor() override; |
| 39 | 39 |
| 40 std::unique_ptr<CommitContribution> GetContribution( | 40 std::unique_ptr<CommitContribution> GetContribution( |
| 41 size_t max_entries) override; | 41 size_t max_entries) override; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 syncable::Directory* dir_; | 44 syncable::Directory* dir_; |
| 45 ModelType type_; | 45 ModelType type_; |
| 46 | 46 |
| 47 DirectoryTypeDebugInfoEmitter* debug_info_emitter_; | 47 DataTypeDebugInfoEmitter* debug_info_emitter_; |
| 48 | 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(DirectoryCommitContributor); | 49 DISALLOW_COPY_AND_ASSIGN(DirectoryCommitContributor); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace syncer | 52 } // namespace syncer |
| 53 | 53 |
| 54 #endif // COMPONENTS_SYNC_ENGINE_IMPL_DIRECTORY_COMMIT_CONTRIBUTOR_H_ | 54 #endif // COMPONENTS_SYNC_ENGINE_IMPL_DIRECTORY_COMMIT_CONTRIBUTOR_H_ |
| OLD | NEW |