Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_GET_COMMIT_IDS_COMMAND_H_ | 5 #ifndef SYNC_ENGINE_GET_COMMIT_IDS_COMMAND_H_ |
| 6 #define SYNC_ENGINE_GET_COMMIT_IDS_COMMAND_H_ | 6 #define SYNC_ENGINE_GET_COMMIT_IDS_COMMAND_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 | 33 |
| 34 public: | 34 public: |
| 35 // The batch_size parameter is the maximum number of entries we are allowed | 35 // The batch_size parameter is the maximum number of entries we are allowed |
| 36 // to commit in a single batch. This value can be modified by the server. | 36 // to commit in a single batch. This value can be modified by the server. |
| 37 // | 37 // |
| 38 // The ordered_commit_set parameter is an output parameter that will contain a | 38 // The ordered_commit_set parameter is an output parameter that will contain a |
| 39 // set of items that are ready to commit. Its size shall not exceed the | 39 // set of items that are ready to commit. Its size shall not exceed the |
| 40 // provided batch_size. This contents of this "set" will be ordered; see the | 40 // provided batch_size. This contents of this "set" will be ordered; see the |
| 41 // comments in this class' implementation for details. | 41 // comments in this class' implementation for details. |
| 42 GetCommitIdsCommand(syncable::BaseTransaction* trans, | 42 GetCommitIdsCommand(syncable::BaseTransaction* trans, |
| 43 ModelTypeSet requested_types, | |
| 43 const size_t commit_batch_size, | 44 const size_t commit_batch_size, |
| 44 sessions::OrderedCommitSet* ordered_commit_set); | 45 sessions::OrderedCommitSet* ordered_commit_set); |
| 45 virtual ~GetCommitIdsCommand(); | 46 virtual ~GetCommitIdsCommand(); |
| 46 | 47 |
| 47 // SyncerCommand implementation. | 48 // SyncerCommand implementation. |
| 48 virtual SyncerError ExecuteImpl(sessions::SyncSession* session) OVERRIDE; | 49 virtual SyncerError ExecuteImpl(sessions::SyncSession* session) OVERRIDE; |
| 49 | 50 |
| 50 // Builds a vector of IDs that should be committed. | 51 // Builds a vector of IDs that should be committed. |
| 51 void BuildCommitIds(syncable::BaseTransaction* write_transaction, | 52 void BuildCommitIds(syncable::BaseTransaction* write_transaction, |
| 52 const ModelSafeRoutingInfo& routes, | 53 const ModelSafeRoutingInfo& routes, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 void AddCreatesAndMoves(syncable::BaseTransaction* write_transaction, | 116 void AddCreatesAndMoves(syncable::BaseTransaction* write_transaction, |
| 116 const ModelSafeRoutingInfo& routes, | 117 const ModelSafeRoutingInfo& routes, |
| 117 const std::set<int64>& ready_unsynced_set); | 118 const std::set<int64>& ready_unsynced_set); |
| 118 | 119 |
| 119 void AddDeletes(syncable::BaseTransaction* write_transaction, | 120 void AddDeletes(syncable::BaseTransaction* write_transaction, |
| 120 const std::set<int64>& ready_unsynced_set); | 121 const std::set<int64>& ready_unsynced_set); |
| 121 | 122 |
| 122 // A pointer to a valid transaction not owned by this class. | 123 // A pointer to a valid transaction not owned by this class. |
| 123 syncable::BaseTransaction* trans_; | 124 syncable::BaseTransaction* trans_; |
| 124 | 125 |
| 126 // The set of types from which to draw commit IDs. | |
| 127 ModelTypeSet requested_types_; | |
|
tim (not reviewing)
2013/06/21 21:24:03
const ?
rlarocque
2013/06/24 20:03:08
Done.
| |
| 128 | |
| 125 // Input parameter; see constructor comment. | 129 // Input parameter; see constructor comment. |
| 126 const size_t requested_commit_batch_size_; | 130 const size_t requested_commit_batch_size_; |
| 127 | 131 |
| 128 // Output parameter; see constructor comment. | 132 // Output parameter; see constructor comment. |
| 129 sessions::OrderedCommitSet* commit_set_; | 133 sessions::OrderedCommitSet* commit_set_; |
| 130 | 134 |
| 131 DISALLOW_COPY_AND_ASSIGN(GetCommitIdsCommand); | 135 DISALLOW_COPY_AND_ASSIGN(GetCommitIdsCommand); |
| 132 }; | 136 }; |
| 133 | 137 |
| 134 } // namespace syncer | 138 } // namespace syncer |
| 135 | 139 |
| 136 #endif // SYNC_ENGINE_GET_COMMIT_IDS_COMMAND_H_ | 140 #endif // SYNC_ENGINE_GET_COMMIT_IDS_COMMAND_H_ |
| OLD | NEW |