OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sync/internal_api/public/attachments/attachment_service_proxy.h" | 5 #include "sync/internal_api/public/attachments/attachment_service_proxy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 callback); | 59 callback); |
60 wrapped_task_runner_->PostTask( | 60 wrapped_task_runner_->PostTask( |
61 FROM_HERE, | 61 FROM_HERE, |
62 base::Bind(&AttachmentService::GetOrDownloadAttachments, | 62 base::Bind(&AttachmentService::GetOrDownloadAttachments, |
63 core_, | 63 core_, |
64 attachment_ids, | 64 attachment_ids, |
65 proxy_callback)); | 65 proxy_callback)); |
66 } | 66 } |
67 | 67 |
68 void AttachmentServiceProxy::UploadAttachments( | 68 void AttachmentServiceProxy::UploadAttachments( |
69 const AttachmentIdSet& attachment_ids) { | 69 const AttachmentIdList& attachment_ids) { |
70 DCHECK(wrapped_task_runner_.get()); | 70 DCHECK(wrapped_task_runner_.get()); |
71 wrapped_task_runner_->PostTask( | 71 wrapped_task_runner_->PostTask( |
72 FROM_HERE, | 72 FROM_HERE, |
73 base::Bind(&AttachmentService::UploadAttachments, core_, attachment_ids)); | 73 base::Bind(&AttachmentService::UploadAttachments, core_, attachment_ids)); |
74 } | 74 } |
75 | 75 |
76 AttachmentServiceProxy::Core::Core( | 76 AttachmentServiceProxy::Core::Core( |
77 const base::WeakPtr<syncer::AttachmentService>& wrapped) | 77 const base::WeakPtr<syncer::AttachmentService>& wrapped) |
78 : wrapped_(wrapped) { | 78 : wrapped_(wrapped) { |
79 } | 79 } |
80 | 80 |
81 AttachmentServiceProxy::Core::~Core() { | 81 AttachmentServiceProxy::Core::~Core() { |
82 } | 82 } |
83 | 83 |
84 void AttachmentServiceProxy::Core::GetOrDownloadAttachments( | 84 void AttachmentServiceProxy::Core::GetOrDownloadAttachments( |
85 const AttachmentIdList& attachment_ids, | 85 const AttachmentIdList& attachment_ids, |
86 const GetOrDownloadCallback& callback) { | 86 const GetOrDownloadCallback& callback) { |
87 if (!wrapped_) { | 87 if (!wrapped_) { |
88 return; | 88 return; |
89 } | 89 } |
90 wrapped_->GetOrDownloadAttachments(attachment_ids, callback); | 90 wrapped_->GetOrDownloadAttachments(attachment_ids, callback); |
91 } | 91 } |
92 | 92 |
93 void AttachmentServiceProxy::Core::UploadAttachments( | 93 void AttachmentServiceProxy::Core::UploadAttachments( |
94 const AttachmentIdSet& attachment_ids) { | 94 const AttachmentIdList& attachment_ids) { |
95 if (!wrapped_) { | 95 if (!wrapped_) { |
96 return; | 96 return; |
97 } | 97 } |
98 wrapped_->UploadAttachments(attachment_ids); | 98 wrapped_->UploadAttachments(attachment_ids); |
99 } | 99 } |
100 | 100 |
101 } // namespace syncer | 101 } // namespace syncer |
OLD | NEW |