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

Unified Diff: sync/engine/post_commit_message_command.cc

Issue 10038041: sync: Loop committing items without downloading updates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
Index: sync/engine/post_commit_message_command.cc
diff --git a/sync/engine/post_commit_message_command.cc b/sync/engine/post_commit_message_command.cc
index 8f51f200cfa8d6be3ebc88310b9de434e9fa0813..5e2ee28966bf4bf20a49d1479c59cd6838dcbdbb 100644
--- a/sync/engine/post_commit_message_command.cc
+++ b/sync/engine/post_commit_message_command.cc
@@ -8,42 +8,24 @@
#include "base/location.h"
#include "sync/engine/syncer_proto_util.h"
-#include "sync/engine/syncproto.h"
#include "sync/sessions/sync_session.h"
using std::vector;
namespace browser_sync {
-PostCommitMessageCommand::PostCommitMessageCommand() {}
+PostCommitMessageCommand::PostCommitMessageCommand(
+ const ClientToServerMessage& message,
+ ClientToServerResponse* response)
+ : commit_message_(message), commit_response_(response) {
+}
+
PostCommitMessageCommand::~PostCommitMessageCommand() {}
SyncerError PostCommitMessageCommand::ExecuteImpl(
sessions::SyncSession* session) {
- if (session->status_controller().commit_ids().empty())
rlarocque 2012/04/13 02:02:22 This if statement is no longer necessary, we break
- return SYNCER_OK; // Nothing to commit.
- ClientToServerResponse response;
- syncable::Directory* dir = session->context()->directory();
- sessions::StatusController* status = session->mutable_status_controller();
- SyncerError result = SyncerProtoUtil::PostClientToServerMessage(
- status->commit_message(), &response, session);
- if (result != SYNCER_OK) {
rlarocque 2012/04/13 02:02:22 I believe this is the wrong place to put this code
- // None of our changes got through. Clear the SYNCING bit which was
- // set to true during BuildCommitCommand, and which may still be true.
- // Not to be confused with IS_UNSYNCED, this bit is used to detect local
- // changes to items that happen during the server Commit operation.
- syncable::WriteTransaction trans(FROM_HERE, syncable::SYNCER, dir);
- const vector<syncable::Id>& commit_ids = status->commit_ids();
- for (size_t i = 0; i < commit_ids.size(); i++) {
- syncable::MutableEntry entry(&trans, syncable::GET_BY_ID, commit_ids[i]);
- entry.Put(syncable::SYNCING, false);
- }
- return result;
- }
-
- status->set_items_committed();
- status->mutable_commit_response()->CopyFrom(response);
- return SYNCER_OK;
+ return SyncerProtoUtil::PostClientToServerMessage(
rlarocque 2012/04/13 02:02:22 Seeing how little is left of this class, I intend
+ commit_message_, commit_response_, session);
}
} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698