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

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

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "sync/internal_api/public/attachments/fake_attachment_uploader.h"
6
7 #include "base/bind.h"
8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h"
11 #include "sync/api/attachments/attachment.h"
12 #include "sync/protocol/sync.pb.h"
13
14 namespace syncer {
15
16 FakeAttachmentUploader::FakeAttachmentUploader() {
17 DCHECK(CalledOnValidThread());
18 }
19
20 FakeAttachmentUploader::~FakeAttachmentUploader() {
21 DCHECK(CalledOnValidThread());
22 }
23
24 void FakeAttachmentUploader::UploadAttachment(const Attachment& attachment,
25 const UploadCallback& callback) {
26 DCHECK(CalledOnValidThread());
27 DCHECK(!attachment.GetId().GetProto().unique_id().empty());
28
29 UploadResult result = UPLOAD_SUCCESS;
30 AttachmentId id = attachment.GetId();
31 base::ThreadTaskRunnerHandle::Get()->PostTask(
32 FROM_HERE, base::Bind(callback, result, id));
33 }
34
35 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698