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

Unified Diff: sync/engine/commit.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/engine/commit.h ('k') | sync/engine/download.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/commit.cc
diff --git a/sync/engine/commit.cc b/sync/engine/commit.cc
index 55fe4f5336f35a49bae377fdca543d63f7309ac6..5081ab3cb2baee44b909e848b822e0629c47aac3 100644
--- a/sync/engine/commit.cc
+++ b/sync/engine/commit.cc
@@ -63,6 +63,7 @@ void ClearSyncingBits(syncable::Directory* dir,
// return value of this function is true.
bool PrepareCommitMessage(
sessions::SyncSession* session,
+ ModelTypeSet requested_types,
sessions::OrderedCommitSet* commit_set,
sync_pb::ClientToServerMessage* commit_message,
ExtensionsActivityMonitor::Records* extensions_activity_buffer) {
@@ -75,7 +76,10 @@ bool PrepareCommitMessage(
// Fetch the items to commit.
const size_t batch_size = session->context()->max_commit_batch_size();
- GetCommitIdsCommand get_commit_ids_command(&trans, batch_size, commit_set);
+ GetCommitIdsCommand get_commit_ids_command(&trans,
+ requested_types,
+ batch_size,
+ commit_set);
get_commit_ids_command.Execute(session);
DVLOG(1) << "Commit message will contain " << commit_set->Size() << " items.";
@@ -94,7 +98,8 @@ bool PrepareCommitMessage(
return true;
}
-SyncerError BuildAndPostCommitsImpl(Syncer* syncer,
+SyncerError BuildAndPostCommitsImpl(ModelTypeSet requested_types,
+ Syncer* syncer,
sessions::SyncSession* session,
sessions::OrderedCommitSet* commit_set) {
while (!syncer->ExitRequested()) {
@@ -102,6 +107,7 @@ SyncerError BuildAndPostCommitsImpl(Syncer* syncer,
ExtensionsActivityMonitor::Records extensions_activity_buffer;
if (!PrepareCommitMessage(session,
+ requested_types,
commit_set,
&commit_message,
&extensions_activity_buffer)) {
@@ -165,10 +171,12 @@ SyncerError BuildAndPostCommitsImpl(Syncer* syncer,
} // namespace
-SyncerError BuildAndPostCommits(Syncer* syncer,
+SyncerError BuildAndPostCommits(ModelTypeSet requested_types,
+ Syncer* syncer,
sessions::SyncSession* session) {
sessions::OrderedCommitSet commit_set(session->context()->routing_info());
- SyncerError result = BuildAndPostCommitsImpl(syncer, session, &commit_set);
+ SyncerError result =
+ BuildAndPostCommitsImpl(requested_types, syncer, session, &commit_set);
if (result != SYNCER_OK) {
ClearSyncingBits(session->context()->directory(), commit_set);
}
« no previous file with comments | « sync/engine/commit.h ('k') | sync/engine/download.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698