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

Unified Diff: components/sync_driver/generic_change_processor.cc

Issue 1035573002: [Sync] Replace AttachmentIdSet with AttachmentIdList in interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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: components/sync_driver/generic_change_processor.cc
diff --git a/components/sync_driver/generic_change_processor.cc b/components/sync_driver/generic_change_processor.cc
index 8f3eff195ecc74aa57e401bd7be78ec8af7c36ec..70ee4cb22c0f2744c6057d309eeb053182ee1eae 100644
--- a/components/sync_driver/generic_change_processor.cc
+++ b/components/sync_driver/generic_change_processor.cc
@@ -471,7 +471,11 @@ syncer::SyncError GenericChangeProcessor::ProcessSyncChanges(
NOTREACHED();
return error;
}
- attachment_service_->UploadAttachments(new_attachments);
+ syncer::AttachmentIdList ids_to_upload;
+ ids_to_upload.reserve(new_attachments.size());
+ std::copy(new_attachments.begin(), new_attachments.end(),
+ std::back_inserter(ids_to_upload));
+ attachment_service_->UploadAttachments(ids_to_upload);
}
return syncer::SyncError();
@@ -705,13 +709,13 @@ syncer::UserShare* GenericChangeProcessor::share_handle() const {
void GenericChangeProcessor::UploadAllAttachmentsNotOnServer() {
DCHECK(CalledOnValidThread());
DCHECK(attachment_service_.get());
- syncer::AttachmentIdSet id_set;
+ syncer::AttachmentIdList ids;
{
syncer::ReadTransaction trans(FROM_HERE, share_handle());
- trans.GetAttachmentIdsToUpload(type_, &id_set);
+ trans.GetAttachmentIdsToUpload(type_, &ids);
}
- if (!id_set.empty()) {
- attachment_service_->UploadAttachments(id_set);
+ if (!ids.empty()) {
+ attachment_service_->UploadAttachments(ids);
}
}

Powered by Google App Engine
This is Rietveld 408576698