Index: components/sync/api/attachments/attachment_service.cc |
diff --git a/components/sync/api/attachments/attachment_service.cc b/components/sync/api/attachments/attachment_service.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..32db79c067c19ee0f6898ed271d32b1a690706e5 |
--- /dev/null |
+++ b/components/sync/api/attachments/attachment_service.cc |
@@ -0,0 +1,44 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "components/sync/api/attachments/attachment_service.h" |
+ |
+#include <utility> |
+ |
+#include "base/memory/ptr_util.h" |
+#include "components/sync/api/attachments/attachment_store.h" |
+#include "components/sync/api_impl/attachments/attachment_service_impl.h" |
+#include "components/sync/engine/attachments/fake_attachment_downloader.h" |
+#include "components/sync/engine/attachments/fake_attachment_uploader.h" |
+ |
+namespace syncer { |
+ |
+// static |
+std::unique_ptr<AttachmentService> AttachmentService::Create( |
+ std::unique_ptr<AttachmentStoreForSync> attachment_store, |
+ std::unique_ptr<AttachmentUploader> attachment_uploader, |
+ std::unique_ptr<AttachmentDownloader> attachment_downloader, |
+ Delegate* delegate, |
+ const base::TimeDelta& initial_backoff_delay, |
+ const base::TimeDelta& max_backoff_delay) { |
+ return base::MakeUnique<AttachmentServiceImpl>( |
+ std::move(attachment_store), std::move(attachment_uploader), |
+ std::move(attachment_downloader), delegate, initial_backoff_delay, |
+ max_backoff_delay); |
+} |
+ |
+// static |
+std::unique_ptr<AttachmentService> AttachmentService::CreateForTest() { |
+ std::unique_ptr<AttachmentStore> attachment_store = |
+ AttachmentStore::CreateInMemoryStore(); |
+ return base::MakeUnique<AttachmentServiceImpl>( |
+ attachment_store->CreateAttachmentStoreForSync(), |
+ base::MakeUnique<FakeAttachmentUploader>(), |
+ base::MakeUnique<FakeAttachmentDownloader>(), nullptr, base::TimeDelta(), |
+ base::TimeDelta()); |
+} |
+ |
+AttachmentService::~AttachmentService() {} |
+ |
+} // namespace syncer |