| 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_CONTRIBUTION_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_DIRECTORY_COMMIT_CONTRIBUTION_H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_IMPL_DIRECTORY_COMMIT_CONTRIBUTION_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_DIRECTORY_COMMIT_CONTRIBUTION_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "components/sync/base/model_type.h" | 16 #include "components/sync/base/model_type.h" |
| 17 #include "components/sync/base/syncer_error.h" | 17 #include "components/sync/base/syncer_error.h" |
| 18 #include "components/sync/engine_impl/commit_contribution.h" | 18 #include "components/sync/engine_impl/commit_contribution.h" |
| 19 #include "components/sync/engine_impl/cycle/directory_type_debug_info_emitter.h" |
| 20 #include "components/sync/engine_impl/cycle/status_controller.h" |
| 19 #include "components/sync/protocol/sync.pb.h" | 21 #include "components/sync/protocol/sync.pb.h" |
| 20 #include "components/sync/sessions_impl/directory_type_debug_info_emitter.h" | |
| 21 #include "components/sync/sessions_impl/status_controller.h" | |
| 22 | 22 |
| 23 namespace syncer { | 23 namespace syncer { |
| 24 | 24 |
| 25 namespace sessions { | |
| 26 class StatusController; | 25 class StatusController; |
| 27 } // namespace sessions | |
| 28 | 26 |
| 29 namespace syncable { | 27 namespace syncable { |
| 30 class Directory; | 28 class Directory; |
| 31 } // namespace syncable | 29 } // namespace syncable |
| 32 | 30 |
| 33 // This class represents a set of items belonging to a particular data type that | 31 // This class represents a set of items belonging to a particular data type that |
| 34 // have been selected from the syncable Directory and prepared for commit. | 32 // have been selected from the syncable Directory and prepared for commit. |
| 35 // | 33 // |
| 36 // This class handles the bookkeeping related to the commit of these items, | 34 // This class handles the bookkeeping related to the commit of these items, |
| 37 // including processing the commit response message and setting and unsetting | 35 // including processing the commit response message and setting and unsetting |
| (...skipping 23 matching lines...) Expand all Loading... |
| 61 void AddToCommitMessage(sync_pb::ClientToServerMessage* msg) override; | 59 void AddToCommitMessage(sync_pb::ClientToServerMessage* msg) override; |
| 62 | 60 |
| 63 // Updates this contribution's contents in accordance with the provided | 61 // Updates this contribution's contents in accordance with the provided |
| 64 // |response|. | 62 // |response|. |
| 65 // | 63 // |
| 66 // This function may make model-neutral changes to the directory. It is not | 64 // This function may make model-neutral changes to the directory. It is not |
| 67 // valid to call this function unless AddToCommitMessage() was called earlier. | 65 // valid to call this function unless AddToCommitMessage() was called earlier. |
| 68 // This function should not be called more than once. | 66 // This function should not be called more than once. |
| 69 SyncerError ProcessCommitResponse( | 67 SyncerError ProcessCommitResponse( |
| 70 const sync_pb::ClientToServerResponse& response, | 68 const sync_pb::ClientToServerResponse& response, |
| 71 sessions::StatusController* status) override; | 69 StatusController* status) override; |
| 72 | 70 |
| 73 // Cleans up any temporary state associated with the commit. Must be called | 71 // Cleans up any temporary state associated with the commit. Must be called |
| 74 // before destruction. | 72 // before destruction. |
| 75 void CleanUp() override; | 73 void CleanUp() override; |
| 76 | 74 |
| 77 // Returns the number of entries included in this contribution. | 75 // Returns the number of entries included in this contribution. |
| 78 size_t GetNumEntries() const override; | 76 size_t GetNumEntries() const override; |
| 79 | 77 |
| 80 private: | 78 private: |
| 81 class DirectoryCommitContributionTest; | 79 class DirectoryCommitContributionTest; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 105 | 103 |
| 106 // A pointer to the commit counters of our parent CommitContributor. | 104 // A pointer to the commit counters of our parent CommitContributor. |
| 107 DirectoryTypeDebugInfoEmitter* debug_info_emitter_; | 105 DirectoryTypeDebugInfoEmitter* debug_info_emitter_; |
| 108 | 106 |
| 109 DISALLOW_COPY_AND_ASSIGN(DirectoryCommitContribution); | 107 DISALLOW_COPY_AND_ASSIGN(DirectoryCommitContribution); |
| 110 }; | 108 }; |
| 111 | 109 |
| 112 } // namespace syncer | 110 } // namespace syncer |
| 113 | 111 |
| 114 #endif // COMPONENTS_SYNC_ENGINE_IMPL_DIRECTORY_COMMIT_CONTRIBUTION_H_ | 112 #endif // COMPONENTS_SYNC_ENGINE_IMPL_DIRECTORY_COMMIT_CONTRIBUTION_H_ |
| OLD | NEW |