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

Unified Diff: sync/engine/model_type_worker.cc

Issue 1933803002: [Sync] USS: Ignore encryption changes during conflict resolution 2/2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment. Created 4 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
« no previous file with comments | « sync/engine/model_type_worker.h ('k') | sync/engine/model_type_worker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/model_type_worker.cc
diff --git a/sync/engine/model_type_worker.cc b/sync/engine/model_type_worker.cc
index a34b94cc58e4b7f2c9e84291cde40ef38acbf442..53aeba1611c49835721db118f6bfddda5c85160a 100644
--- a/sync/engine/model_type_worker.cc
+++ b/sync/engine/model_type_worker.cc
@@ -223,7 +223,6 @@ std::unique_ptr<CommitContribution> ModelTypeWorker::GetContribution(
DCHECK(pending_updates_.empty());
size_t space_remaining = max_entries;
- std::vector<int64_t> sequence_numbers;
google::protobuf::RepeatedPtrField<sync_pb::SyncEntity> commit_entities;
if (!CanCommitItems())
@@ -235,12 +234,8 @@ std::unique_ptr<CommitContribution> ModelTypeWorker::GetContribution(
WorkerEntityTracker* entity = it->second.get();
if (entity->HasPendingCommit()) {
sync_pb::SyncEntity* commit_entity = commit_entities.Add();
- int64_t sequence_number = -1;
-
- entity->PopulateCommitProto(commit_entity, &sequence_number);
+ entity->PopulateCommitProto(commit_entity);
AdjustCommitProto(commit_entity);
- sequence_numbers.push_back(sequence_number);
-
space_remaining--;
}
}
@@ -250,13 +245,11 @@ std::unique_ptr<CommitContribution> ModelTypeWorker::GetContribution(
return std::unique_ptr<CommitContribution>(
new NonBlockingTypeCommitContribution(data_type_state_.type_context(),
- commit_entities, sequence_numbers,
- this));
+ commit_entities, this));
}
-void ModelTypeWorker::OnCommitResponse(
- const CommitResponseDataList& response_list) {
- for (const CommitResponseData& response : response_list) {
+void ModelTypeWorker::OnCommitResponse(CommitResponseDataList* response_list) {
+ for (CommitResponseData& response : *response_list) {
WorkerEntityTracker* entity = GetEntityTracker(response.client_tag_hash);
// There's no way we could have committed an entry we know nothing about.
@@ -267,14 +260,13 @@ void ModelTypeWorker::OnCommitResponse(
continue;
}
- entity->ReceiveCommitResponse(response.id, response.response_version,
- response.sequence_number);
+ entity->ReceiveCommitResponse(&response);
}
// Send the responses back to the model thread. It needs to know which
// items have been successfully committed so it can save that information in
// permanent storage.
- model_type_processor_->OnCommitCompleted(data_type_state_, response_list);
+ model_type_processor_->OnCommitCompleted(data_type_state_, *response_list);
}
base::WeakPtr<ModelTypeWorker> ModelTypeWorker::AsWeakPtr() {
« no previous file with comments | « sync/engine/model_type_worker.h ('k') | sync/engine/model_type_worker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698