summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/attachments/attachment_service_proxy.cc
diff options
context:
space:
mode:
authorErik Arvidsson <arv@chromium.org>2014-09-05 13:10:48 -0400
committerErik Arvidsson <arv@chromium.org>2014-09-05 17:12:34 +0000
commite4c008c95e47155ad924d04f697cdf7272049a7d (patch)
tree8afd17f0de1b139e44611a048b75c4d470063864 /sync/internal_api/attachments/attachment_service_proxy.cc
parent8816ae54afab2da619a7ee23a50b90869b4b2a90 (diff)
downloadchromium_src-e4c008c95e47155ad924d04f697cdf7272049a7d.zip
chromium_src-e4c008c95e47155ad924d04f697cdf7272049a7d.tar.gz
chromium_src-e4c008c95e47155ad924d04f697cdf7272049a7d.tar.bz2
Revert "Replace AttachmentStore's StoreAttachments with UploadAttachments."
This reverts commit 5dde06853d1d5020796184c5fc749b9730ce8f07. Broke a bunch of builds: FAILED: /mnt/data/b/build/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/sync/internal_api/attachments/sync_core.attachment_service_proxy.o.d -DSYNC_IMPLEMENTATION -DCHROMIUM_BUILD -DENABLE_NOTIFICATIONS -DENABLE_EGLIMAGE=1 -DENABLE_BACKGROUND=1 -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -DENABLE_MDNS=1 -DENABLE_PEPPER_CDMS -DENABLE_PLUGINS=1 -DENABLE_PRINTING=1 -DENABLE_FULL_PRINTING=1 -DENABLE_SPELLCHECK=1 -DUSE_UDEV -DTOOLKIT_VIEWS=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_ASH=1 -DUSE_AURA=1 -DUSE_CAIRO=1 -DUSE_CLIPBOARD_AURAX11=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_GLIB=1 -DUSE_NSS=1 -DUSE_X11=1 -DUSE_XI2_MT=2 -DDISABLE_NACL -DENABLE_EXTENSIONS=1 -DENABLE_CONFIGURATION_POLICY -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_MANAGED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_REMOTING=1 -DENABLE_GOOGLE_NOW=1 -DENABLE_ONE_CLICK_SIGNIN -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DPROTOBUF_USE_DLLS -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -I../.. -Igen -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I../../net/third_party/nss/ssl -I/usr/include/nss -I/usr/include/nspr -I../../third_party/zlib -Igen/protoc_out -I../../third_party/protobuf/src -I../../third_party/protobuf -fno-strict-aliasing -fstack-protector --param=ssp-buffer-size=4 -m64 -funwind-tables -fPIC -pipe -pthread -fcolor-diagnostics -Wall -Wsign-compare -Wendif-labels -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-char-subscripts -Wno-covered-switch-default -Wno-deprecated-register -Wno-unused-function -fvisibility=hidden -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Wheader-hygiene -Wstring-conversion -fno-ident -fdata-sections -ffunction-sections -O2 -g2 -Wexit-time-destructors -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -Wno-reserved-user-defined-literal -fno-rtti -fno-exceptions -c ../../sync/internal_api/attachments/attachment_service_proxy.cc -o obj/sync/internal_api/attachments/sync_core.attachment_service_proxy.o ../../sync/internal_api/attachments/attachment_service_proxy.cc:96:3: error: invalid argument type 'scoped_refptr<base::SequencedTaskRunner>' to unary expression DCHECK(wrapped_task_runner_); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../base/logging.h:622:51: note: expanded from macro 'DCHECK' LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON && !(condition)) \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ ../../base/logging.h:355:5: note: expanded from macro 'LAZY_STREAM' !(condition) ? (void) 0 : ::logging::LogMessageVoidify() & (stream) ^ 1 error generated. ninja: build stopped: subcommand failed. BUG=none TBR=maniscalco Review URL: https://codereview.chromium.org/546873003 Cr-Commit-Position: refs/heads/master@{#293542}
Diffstat (limited to 'sync/internal_api/attachments/attachment_service_proxy.cc')
-rw-r--r--sync/internal_api/attachments/attachment_service_proxy.cc37
1 files changed, 22 insertions, 15 deletions
diff --git a/sync/internal_api/attachments/attachment_service_proxy.cc b/sync/internal_api/attachments/attachment_service_proxy.cc
index ef858dd..1d41878 100644
--- a/sync/internal_api/attachments/attachment_service_proxy.cc
+++ b/sync/internal_api/attachments/attachment_service_proxy.cc
@@ -35,6 +35,15 @@ void ProxyDropCallback(
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() {
@@ -58,10 +67,6 @@ AttachmentServiceProxy::AttachmentServiceProxy(
AttachmentServiceProxy::~AttachmentServiceProxy() {
}
-AttachmentStore* AttachmentServiceProxy::GetStore() {
- return NULL;
-}
-
void AttachmentServiceProxy::GetOrDownloadAttachments(
const AttachmentIdList& attachment_ids,
const GetOrDownloadCallback& callback) {
@@ -91,12 +96,17 @@ void AttachmentServiceProxy::DropAttachments(
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(
@@ -107,10 +117,6 @@ AttachmentServiceProxy::Core::Core(
AttachmentServiceProxy::Core::~Core() {
}
-AttachmentStore* AttachmentServiceProxy::Core::GetStore() {
- return NULL;
-}
-
void AttachmentServiceProxy::Core::GetOrDownloadAttachments(
const AttachmentIdList& attachment_ids,
const GetOrDownloadCallback& callback) {
@@ -129,12 +135,13 @@ void AttachmentServiceProxy::Core::DropAttachments(
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