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

Side by Side Diff: sync/internal_api/attachments/fake_attachment_uploader.cc

Issue 394293003: Do not update AttachmentIds after uploading attachments to sync server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/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 #include "sync/protocol/sync.pb.h" 10 #include "sync/protocol/sync.pb.h"
11 11
12 namespace syncer { 12 namespace syncer {
13 13
14 FakeAttachmentUploader::FakeAttachmentUploader() { 14 FakeAttachmentUploader::FakeAttachmentUploader() {
15 DCHECK(CalledOnValidThread()); 15 DCHECK(CalledOnValidThread());
16 } 16 }
17 17
18 FakeAttachmentUploader::~FakeAttachmentUploader() { 18 FakeAttachmentUploader::~FakeAttachmentUploader() {
19 DCHECK(CalledOnValidThread()); 19 DCHECK(CalledOnValidThread());
20 } 20 }
21 21
22 void FakeAttachmentUploader::UploadAttachment(const Attachment& attachment, 22 void FakeAttachmentUploader::UploadAttachment(const Attachment& attachment,
23 const UploadCallback& callback) { 23 const UploadCallback& callback) {
24 DCHECK(CalledOnValidThread()); 24 DCHECK(CalledOnValidThread());
25 DCHECK(!attachment.GetId().GetProto().unique_id().empty()); 25 DCHECK(!attachment.GetId().GetProto().unique_id().empty());
26 26
27 UploadResult result = UPLOAD_SUCCESS; 27 UploadResult result = UPLOAD_SUCCESS;
28 AttachmentId updated_id = attachment.GetId(); 28 AttachmentId id = attachment.GetId();
29 // TODO(maniscalco): Update the attachment id with server address information 29 base::MessageLoop::current()->PostTask(FROM_HERE,
30 // before passing it to the callback. 30 base::Bind(callback, result, id));
31 base::MessageLoop::current()->PostTask(
32 FROM_HERE, base::Bind(callback, result, updated_id));
33 } 31 }
34 32
35 } // namespace syncer 33 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/attachments/attachment_uploader_impl_unittest.cc ('k') | sync/internal_api/public/write_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698