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/api/attachments/fake_attachment_uploader.h" | 5 #include "sync/internal_api/public/attachments/fake_attachment_uploader.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 "sync/api/attachments/attachment.h" | 9 #include "sync/api/attachments/attachment.h" |
10 | 10 |
11 namespace syncer { | 11 namespace syncer { |
12 | 12 |
13 FakeAttachmentUploader::FakeAttachmentUploader() { | 13 FakeAttachmentUploader::FakeAttachmentUploader() { |
14 DCHECK(CalledOnValidThread()); | 14 DCHECK(CalledOnValidThread()); |
15 } | 15 } |
16 | 16 |
17 FakeAttachmentUploader::~FakeAttachmentUploader() { | 17 FakeAttachmentUploader::~FakeAttachmentUploader() { |
18 DCHECK(CalledOnValidThread()); | 18 DCHECK(CalledOnValidThread()); |
19 } | 19 } |
20 | 20 |
21 void FakeAttachmentUploader::UploadAttachment(const Attachment& attachment, | 21 void FakeAttachmentUploader::UploadAttachment(const Attachment& attachment, |
22 const UploadCallback& callback) { | 22 const UploadCallback& callback) { |
23 DCHECK(CalledOnValidThread()); | 23 DCHECK(CalledOnValidThread()); |
24 UploadResult result = UPLOAD_SUCCESS; | 24 UploadResult result = UPLOAD_SUCCESS; |
25 AttachmentId updated_id = attachment.GetId(); | 25 AttachmentId updated_id = attachment.GetId(); |
26 // TODO(maniscalco): Update the attachment id with server address information | 26 // TODO(maniscalco): Update the attachment id with server address information |
27 // before passing it to the callback. | 27 // before passing it to the callback. |
28 base::MessageLoop::current()->PostTask( | 28 base::MessageLoop::current()->PostTask( |
29 FROM_HERE, base::Bind(callback, result, updated_id)); | 29 FROM_HERE, base::Bind(callback, result, updated_id)); |
30 } | 30 } |
31 | 31 |
32 } // namespace syncer | 32 } // namespace syncer |
OLD | NEW |