OLD | NEW |
(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 "components/sync/api/attachments/attachment_service.h" |
| 6 |
| 7 #include <utility> |
| 8 |
| 9 #include "base/memory/ptr_util.h" |
| 10 #include "components/sync/api/attachments/attachment_store.h" |
| 11 #include "components/sync/api_impl/attachments/attachment_service_impl.h" |
| 12 #include "components/sync/engine/attachments/fake_attachment_downloader.h" |
| 13 #include "components/sync/engine/attachments/fake_attachment_uploader.h" |
| 14 |
| 15 namespace syncer { |
| 16 |
| 17 // static |
| 18 std::unique_ptr<AttachmentService> AttachmentService::Create( |
| 19 std::unique_ptr<AttachmentStoreForSync> attachment_store, |
| 20 std::unique_ptr<AttachmentUploader> attachment_uploader, |
| 21 std::unique_ptr<AttachmentDownloader> attachment_downloader, |
| 22 Delegate* delegate, |
| 23 const base::TimeDelta& initial_backoff_delay, |
| 24 const base::TimeDelta& max_backoff_delay) { |
| 25 return base::MakeUnique<AttachmentServiceImpl>( |
| 26 std::move(attachment_store), std::move(attachment_uploader), |
| 27 std::move(attachment_downloader), delegate, initial_backoff_delay, |
| 28 max_backoff_delay); |
| 29 } |
| 30 |
| 31 // static |
| 32 std::unique_ptr<AttachmentService> AttachmentService::CreateForTest() { |
| 33 std::unique_ptr<AttachmentStore> attachment_store = |
| 34 AttachmentStore::CreateInMemoryStore(); |
| 35 return base::MakeUnique<AttachmentServiceImpl>( |
| 36 attachment_store->CreateAttachmentStoreForSync(), |
| 37 base::MakeUnique<FakeAttachmentUploader>(), |
| 38 base::MakeUnique<FakeAttachmentDownloader>(), nullptr, base::TimeDelta(), |
| 39 base::TimeDelta()); |
| 40 } |
| 41 |
| 42 AttachmentService::~AttachmentService() {} |
| 43 |
| 44 } // namespace syncer |
OLD | NEW |