Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: sync/engine/get_commit_ids_command.h

Issue 15764010: Experimental functionize patch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync: Expose sync functionality as functions Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/engine/download_updates_command_unittest.cc ('k') | sync/engine/get_commit_ids_command.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_;
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_
OLDNEW
« no previous file with comments | « sync/engine/download_updates_command_unittest.cc ('k') | sync/engine/get_commit_ids_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698