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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 const scoped_refptr<base::SequencedTaskRunner>& wrapped_task_runner, | 42 const scoped_refptr<base::SequencedTaskRunner>& wrapped_task_runner, |
43 const scoped_refptr<Core>& core) | 43 const scoped_refptr<Core>& core) |
44 : wrapped_task_runner_(wrapped_task_runner), core_(core) { | 44 : wrapped_task_runner_(wrapped_task_runner), core_(core) { |
45 DCHECK(wrapped_task_runner_.get()); | 45 DCHECK(wrapped_task_runner_.get()); |
46 DCHECK(core_.get()); | 46 DCHECK(core_.get()); |
47 } | 47 } |
48 | 48 |
49 AttachmentServiceProxy::~AttachmentServiceProxy() { | 49 AttachmentServiceProxy::~AttachmentServiceProxy() { |
50 } | 50 } |
51 | 51 |
| 52 AttachmentStore* AttachmentServiceProxy::GetStore() { |
| 53 return NULL; |
| 54 } |
| 55 |
52 void AttachmentServiceProxy::GetOrDownloadAttachments( | 56 void AttachmentServiceProxy::GetOrDownloadAttachments( |
53 const AttachmentIdList& attachment_ids, | 57 const AttachmentIdList& attachment_ids, |
54 const GetOrDownloadCallback& callback) { | 58 const GetOrDownloadCallback& callback) { |
55 DCHECK(wrapped_task_runner_.get()); | 59 DCHECK(wrapped_task_runner_.get()); |
56 GetOrDownloadCallback proxy_callback = | 60 GetOrDownloadCallback proxy_callback = |
57 base::Bind(&ProxyGetOrDownloadCallback, | 61 base::Bind(&ProxyGetOrDownloadCallback, |
58 base::ThreadTaskRunnerHandle::Get(), | 62 base::ThreadTaskRunnerHandle::Get(), |
59 callback); | 63 callback); |
60 wrapped_task_runner_->PostTask( | 64 wrapped_task_runner_->PostTask( |
61 FROM_HERE, | 65 FROM_HERE, |
(...skipping 12 matching lines...) Expand all Loading... |
74 } | 78 } |
75 | 79 |
76 AttachmentServiceProxy::Core::Core( | 80 AttachmentServiceProxy::Core::Core( |
77 const base::WeakPtr<syncer::AttachmentService>& wrapped) | 81 const base::WeakPtr<syncer::AttachmentService>& wrapped) |
78 : wrapped_(wrapped) { | 82 : wrapped_(wrapped) { |
79 } | 83 } |
80 | 84 |
81 AttachmentServiceProxy::Core::~Core() { | 85 AttachmentServiceProxy::Core::~Core() { |
82 } | 86 } |
83 | 87 |
| 88 AttachmentStore* AttachmentServiceProxy::Core::GetStore() { |
| 89 return NULL; |
| 90 } |
| 91 |
84 void AttachmentServiceProxy::Core::GetOrDownloadAttachments( | 92 void AttachmentServiceProxy::Core::GetOrDownloadAttachments( |
85 const AttachmentIdList& attachment_ids, | 93 const AttachmentIdList& attachment_ids, |
86 const GetOrDownloadCallback& callback) { | 94 const GetOrDownloadCallback& callback) { |
87 if (!wrapped_) { | 95 if (!wrapped_) { |
88 return; | 96 return; |
89 } | 97 } |
90 wrapped_->GetOrDownloadAttachments(attachment_ids, callback); | 98 wrapped_->GetOrDownloadAttachments(attachment_ids, callback); |
91 } | 99 } |
92 | 100 |
93 void AttachmentServiceProxy::Core::UploadAttachments( | 101 void AttachmentServiceProxy::Core::UploadAttachments( |
94 const AttachmentIdSet& attachment_ids) { | 102 const AttachmentIdSet& attachment_ids) { |
95 if (!wrapped_) { | 103 if (!wrapped_) { |
96 return; | 104 return; |
97 } | 105 } |
98 wrapped_->UploadAttachments(attachment_ids); | 106 wrapped_->UploadAttachments(attachment_ids); |
99 } | 107 } |
100 | 108 |
101 } // namespace syncer | 109 } // namespace syncer |
OLD | NEW |