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

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

Issue 2399953002: [Sync] Move attachments code out of core/. (Closed)
Patch Set: Address comments. 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_store_backend.h
diff --git a/components/sync/api/attachments/attachment_store_backend.h b/components/sync/api/attachments/attachment_store_backend.h
deleted file mode 100644
index a014d68f9eab6ebc32facb8d417d870a658284a6..0000000000000000000000000000000000000000
--- a/components/sync/api/attachments/attachment_store_backend.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2015 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.
-
-#ifndef COMPONENTS_SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_BACKEND_H_
-#define COMPONENTS_SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_BACKEND_H_
-
-#include "base/callback.h"
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "components/sync/api/attachments/attachment.h"
-#include "components/sync/api/attachments/attachment_id.h"
-#include "components/sync/api/attachments/attachment_store.h"
-
-namespace base {
-class SequencedTaskRunner;
-} // namespace base
-
-namespace syncer {
-
-// Interface for AttachmentStore backends.
-//
-// AttachmentStoreBackend provides interface for different backends (on-disk,
-// in-memory). Factory methods in AttachmentStore create corresponding backend
-// and pass reference to AttachmentStore.
-// All functions in AttachmentStoreBackend mirror corresponding functions in
-// AttachmentStore.
-// All callbacks and result codes are used directly from AttachmentStore.
-// AttachmentStoreFrontend only passes callbacks and results without modifying
-// them, there is no need to declare separate set.
-class AttachmentStoreBackend {
- public:
- explicit AttachmentStoreBackend(
- const scoped_refptr<base::SequencedTaskRunner>& callback_task_runner);
- virtual ~AttachmentStoreBackend();
- virtual void Init(const AttachmentStore::InitCallback& callback) = 0;
- virtual void Read(AttachmentStore::Component component,
- const AttachmentIdList& ids,
- const AttachmentStore::ReadCallback& callback) = 0;
- virtual void Write(AttachmentStore::Component component,
- const AttachmentList& attachments,
- const AttachmentStore::WriteCallback& callback) = 0;
- virtual void SetReference(AttachmentStore::Component component,
- const AttachmentIdList& ids) = 0;
- virtual void DropReference(AttachmentStore::Component component,
- const AttachmentIdList& ids,
- const AttachmentStore::DropCallback& callback) = 0;
- virtual void ReadMetadataById(
- AttachmentStore::Component component,
- const AttachmentIdList& ids,
- const AttachmentStore::ReadMetadataCallback& callback) = 0;
- virtual void ReadMetadata(
- AttachmentStore::Component component,
- const AttachmentStore::ReadMetadataCallback& callback) = 0;
-
- protected:
- // Helper function to post callback on callback_task_runner.
- void PostCallback(const base::Closure& callback);
-
- private:
- scoped_refptr<base::SequencedTaskRunner> callback_task_runner_;
-
- DISALLOW_COPY_AND_ASSIGN(AttachmentStoreBackend);
-};
-
-} // namespace syncer
-
-#endif // COMPONENTS_SYNC_API_ATTACHMENTS_ATTACHMENT_STORE_BACKEND_H_
« no previous file with comments | « components/sync/api/attachments/attachment_store.cc ('k') | components/sync/api/attachments/attachment_store_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698