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

Unified Diff: components/sync/api/attachments/attachment_service.h

Issue 2399953002: [Sync] Move attachments code out of core/. (Closed)
Patch Set: Fix some things. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/sync/api/attachments/attachment_service.h
diff --git a/components/sync/core/attachments/attachment_service.h b/components/sync/api/attachments/attachment_service.h
similarity index 74%
rename from components/sync/core/attachments/attachment_service.h
rename to components/sync/api/attachments/attachment_service.h
index b59037293dcd382f2f9cd940a85df39bd42edd81..ad1c029d0f9bd8f330f005b369729480e6e3ce0c 100644
--- a/components/sync/core/attachments/attachment_service.h
+++ b/components/sync/api/attachments/attachment_service.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_SYNC_CORE_ATTACHMENTS_ATTACHMENT_SERVICE_H_
-#define COMPONENTS_SYNC_CORE_ATTACHMENTS_ATTACHMENT_SERVICE_H_
+#ifndef COMPONENTS_SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_H_
+#define COMPONENTS_SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_H_
#include <memory>
@@ -13,7 +13,10 @@
namespace syncer {
+class AttachmentDownloader;
class AttachmentStore;
+class AttachmentStoreForSync;
+class AttachmentUploader;
class SyncData;
// AttachmentService is responsible for managing a model type's attachments.
@@ -48,7 +51,18 @@ class AttachmentService {
virtual void OnAttachmentUploaded(const AttachmentId& attachment_id) = 0;
};
- AttachmentService();
+ // Create a concrete AttachmentService.
+ static std::unique_ptr<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);
+
+ // Create an AttachmentService suitable for use in tests.
+ static std::unique_ptr<AttachmentService> CreateForTest();
+
virtual ~AttachmentService();
// See SyncData::GetOrDownloadAttachments.
@@ -72,4 +86,4 @@ class AttachmentService {
} // namespace syncer
-#endif // COMPONENTS_SYNC_CORE_ATTACHMENTS_ATTACHMENT_SERVICE_H_
+#endif // COMPONENTS_SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698