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

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

Issue 538403004: Revert of Replace AttachmentStore's StoreAttachments with UploadAttachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/attachment_service_proxy.cc
diff --git a/sync/internal_api/attachments/attachment_service_proxy.cc b/sync/internal_api/attachments/attachment_service_proxy.cc
index ef858dd935a8609984ae685a9c50f7abe21f8db3..1d418788e11ffdf71c1115484a2f0d7e8b1ae24f 100644
--- a/sync/internal_api/attachments/attachment_service_proxy.cc
+++ b/sync/internal_api/attachments/attachment_service_proxy.cc
@@ -35,6 +35,15 @@
task_runner->PostTask(FROM_HERE, base::Bind(callback, result));
}
+// Invokes |callback| with |result| and |attachments| in the |task_runner|
+// thread.
+void ProxyStoreCallback(
+ const scoped_refptr<base::SequencedTaskRunner>& task_runner,
+ const AttachmentService::StoreCallback& callback,
+ const AttachmentService::StoreResult& result) {
+ task_runner->PostTask(FROM_HERE, base::Bind(callback, result));
+}
+
} // namespace
AttachmentServiceProxy::AttachmentServiceProxy() {
@@ -56,10 +65,6 @@
}
AttachmentServiceProxy::~AttachmentServiceProxy() {
-}
-
-AttachmentStore* AttachmentServiceProxy::GetStore() {
- return NULL;
}
void AttachmentServiceProxy::GetOrDownloadAttachments(
@@ -91,12 +96,17 @@
proxy_callback));
}
-void AttachmentServiceProxy::UploadAttachments(
- const AttachmentIdSet& attachment_ids) {
- DCHECK(wrapped_task_runner_);
+void AttachmentServiceProxy::StoreAttachments(const AttachmentList& attachments,
+ const StoreCallback& callback) {
+ DCHECK(wrapped_task_runner_.get());
+ StoreCallback proxy_callback = base::Bind(
+ &ProxyStoreCallback, base::ThreadTaskRunnerHandle::Get(), callback);
wrapped_task_runner_->PostTask(
FROM_HERE,
- base::Bind(&AttachmentService::UploadAttachments, core_, attachment_ids));
+ base::Bind(&AttachmentService::StoreAttachments,
+ core_,
+ attachments,
+ proxy_callback));
}
AttachmentServiceProxy::Core::Core(
@@ -105,10 +115,6 @@
}
AttachmentServiceProxy::Core::~Core() {
-}
-
-AttachmentStore* AttachmentServiceProxy::Core::GetStore() {
- return NULL;
}
void AttachmentServiceProxy::Core::GetOrDownloadAttachments(
@@ -129,12 +135,13 @@
wrapped_->DropAttachments(attachment_ids, callback);
}
-void AttachmentServiceProxy::Core::UploadAttachments(
- const AttachmentIdSet& attachment_ids) {
+void AttachmentServiceProxy::Core::StoreAttachments(
+ const AttachmentList& attachments,
+ const StoreCallback& callback) {
if (!wrapped_) {
return;
}
- wrapped_->UploadAttachments(attachment_ids);
+ wrapped_->StoreAttachments(attachments, callback);
}
} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698