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

Unified Diff: chrome/browser/sync/engine/process_commit_response_command.h

Issue 2844037: Fix handling of undeletion within the syncer. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Whitespace. Created 10 years, 5 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: chrome/browser/sync/engine/process_commit_response_command.h
diff --git a/chrome/browser/sync/engine/process_commit_response_command.h b/chrome/browser/sync/engine/process_commit_response_command.h
index 351db1c7dd7ca2f976bf2e463d9544d62f8e1d12..96253d85868bc471cd027933a3d12cc990db20db 100644
--- a/chrome/browser/sync/engine/process_commit_response_command.h
+++ b/chrome/browser/sync/engine/process_commit_response_command.h
@@ -32,24 +32,59 @@ class ProcessCommitResponseCommand : public ModelChangingSyncerCommand {
private:
CommitResponse::ResponseType ProcessSingleCommitResponse(
syncable::WriteTransaction* trans,
- const sync_pb::CommitResponse_EntryResponse& pb_server_entry,
- const syncable::Id& pre_commit_id, std::set<syncable::Id>*
- conflicting_new_directory_ids,
+ const sync_pb::CommitResponse_EntryResponse& pb_commit_response,
+ const sync_pb::SyncEntity& pb_committed_entry,
+ const syncable::Id& pre_commit_id,
+ std::set<syncable::Id>* conflicting_new_directory_ids,
std::set<syncable::Id>* deleted_folders);
// Actually does the work of execute.
void ProcessCommitResponse(sessions::SyncSession* session);
- void ProcessSuccessfulCommitResponse(syncable::WriteTransaction* trans,
- const CommitResponse_EntryResponse& server_entry,
+ void ProcessSuccessfulCommitResponse(
+ const sync_pb::SyncEntity& committed_entry,
+ const CommitResponse_EntryResponse& entry_response,
const syncable::Id& pre_commit_id, syncable::MutableEntry* local_entry,
bool syncing_was_set, std::set<syncable::Id>* deleted_folders);
- void PerformCommitTimeNameAside(
- syncable::WriteTransaction* trans,
- const CommitResponse_EntryResponse& server_entry,
+ // Update the BASE_VERSION and SERVER_VERSION, post-commit.
+ // Helper for ProcessSuccessfulCommitResponse.
+ bool UpdateVersionAfterCommit(
+ const sync_pb::SyncEntity& committed_entry,
+ const CommitResponse_EntryResponse& entry_response,
+ const syncable::Id& pre_commit_id,
+ syncable::MutableEntry* local_entry);
+
+ // If the server generated an ID for us during a commit, apply the new ID.
+ // Helper for ProcessSuccessfulCommitResponse.
+ bool ChangeIdAfterCommit(
+ const CommitResponse_EntryResponse& entry_response,
+ const syncable::Id& pre_commit_id,
+ syncable::MutableEntry* local_entry);
+
+ // Update the SERVER_ fields to reflect the server state after committing.
+ // Helper for ProcessSuccessfulCommitResponse.
+ void UpdateServerFieldsAfterCommit(
+ const sync_pb::SyncEntity& committed_entry,
+ const CommitResponse_EntryResponse& entry_response,
+ syncable::MutableEntry* local_entry);
+
+ // The server can override some values during a commit; the overridden values
+ // are returned as fields in the CommitResponse_EntryResponse. This method
+ // stores the fields back in the client-visible (i.e. not the SERVER_* fields)
+ // fields of the entry. This should only be done if the item did not change
+ // locally while the commit was in flight.
+ // Helper for ProcessSuccessfulCommitResponse.
+ void OverrideClientFieldsAfterCommit(
+ const sync_pb::SyncEntity& committed_entry,
+ const CommitResponse_EntryResponse& entry_response,
syncable::MutableEntry* local_entry);
+ // Helper to extract the final name from the protobufs.
+ const string& GetResultingPostCommitName(
+ const sync_pb::SyncEntity& committed_entry,
+ const CommitResponse_EntryResponse& entry_response);
+
DISALLOW_COPY_AND_ASSIGN(ProcessCommitResponseCommand);
};

Powered by Google App Engine
This is Rietveld 408576698