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

Unified Diff: sync/internal_api/attachments/fake_attachment_store.cc

Issue 293143002: Add AttachmentDownloader interface, change signature of AttachmentStore::Read (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes after feedback from Nick Created 6 years, 7 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/internal_api/attachments/fake_attachment_store.cc
diff --git a/sync/internal_api/attachments/fake_attachment_store.cc b/sync/internal_api/attachments/fake_attachment_store.cc
index 40224bd5738e8439bddaf592ced4e65735c46b56..cb3c3f4bf02f0de2580ec97cf129f6ef9d5a4d5e 100644
--- a/sync/internal_api/attachments/fake_attachment_store.cc
+++ b/sync/internal_api/attachments/fake_attachment_store.cc
@@ -47,6 +47,7 @@ void FakeAttachmentStore::Backend::Read(const AttachmentIdList& ids,
AttachmentIdList::const_iterator id_iter = ids.begin();
AttachmentIdList::const_iterator id_end = ids.end();
scoped_ptr<AttachmentMap> result_map(new AttachmentMap);
+ scoped_ptr<AttachmentIdList> unavailable_attachments(new AttachmentIdList);
for (; id_iter != id_end; ++id_iter) {
const AttachmentId& id = *id_iter;
syncer::AttachmentMap::iterator attachment_iter =
@@ -55,12 +56,18 @@ void FakeAttachmentStore::Backend::Read(const AttachmentIdList& ids,
const Attachment& attachment = attachment_iter->second;
result_map->insert(std::make_pair(id, attachment));
} else {
- result_code = UNSPECIFIED_ERROR;
- break;
+ unavailable_attachments->push_back(id);
}
}
+ if (!unavailable_attachments->empty()) {
+ result_code = UNSPECIFIED_ERROR;
+ }
frontend_task_runner_->PostTask(
- FROM_HERE, base::Bind(callback, result_code, base::Passed(&result_map)));
+ FROM_HERE,
+ base::Bind(callback,
+ result_code,
+ base::Passed(&result_map),
+ base::Passed(&unavailable_attachments)));
}
void FakeAttachmentStore::Backend::Write(const AttachmentList& attachments,
« no previous file with comments | « sync/api/attachments/attachment_uploader.h ('k') | sync/internal_api/attachments/fake_attachment_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698