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

Unified Diff: sync/internal_api/attachments/attachment_store_frontend.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, 5 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: sync/internal_api/attachments/attachment_store_frontend.cc
diff --git a/sync/internal_api/attachments/attachment_store_frontend.cc b/sync/internal_api/attachments/attachment_store_frontend.cc
deleted file mode 100644
index 31f14b63e89cd9503e286e0337b79245988f5607..0000000000000000000000000000000000000000
--- a/sync/internal_api/attachments/attachment_store_frontend.cc
+++ /dev/null
@@ -1,112 +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.
-
-#include "sync/internal_api/public/attachments/attachment_store_frontend.h"
-
-#include <utility>
-
-#include "base/bind.h"
-#include "base/location.h"
-#include "base/sequenced_task_runner.h"
-#include "sync/api/attachments/attachment.h"
-#include "sync/api/attachments/attachment_store_backend.h"
-
-namespace syncer {
-
-namespace {
-
-// NoOp is needed to bind base::Passed(backend) in AttachmentStoreFrontend dtor.
-// It doesn't need to do anything.
-void NoOp(std::unique_ptr<AttachmentStoreBackend> backend) {}
-
-} // namespace
-
-AttachmentStoreFrontend::AttachmentStoreFrontend(
- std::unique_ptr<AttachmentStoreBackend> backend,
- const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner)
- : backend_(std::move(backend)), backend_task_runner_(backend_task_runner) {
- DCHECK(backend_);
- DCHECK(backend_task_runner_.get());
-}
-
-AttachmentStoreFrontend::~AttachmentStoreFrontend() {
- DCHECK(backend_);
- // To delete backend post task that doesn't do anything, but binds backend
- // through base::Passed. This way backend will be deleted regardless whether
- // task runs or not.
- backend_task_runner_->PostTask(FROM_HERE,
- base::Bind(&NoOp, base::Passed(&backend_)));
-}
-
-void AttachmentStoreFrontend::Init(
- const AttachmentStore::InitCallback& callback) {
- DCHECK(CalledOnValidThread());
- backend_task_runner_->PostTask(
- FROM_HERE, base::Bind(&AttachmentStoreBackend::Init,
- base::Unretained(backend_.get()), callback));
-}
-
-void AttachmentStoreFrontend::Read(
- AttachmentStore::Component component,
- const AttachmentIdList& ids,
- const AttachmentStore::ReadCallback& callback) {
- DCHECK(CalledOnValidThread());
- backend_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&AttachmentStoreBackend::Read,
- base::Unretained(backend_.get()), component, ids, callback));
-}
-
-void AttachmentStoreFrontend::Write(
- AttachmentStore::Component component,
- const AttachmentList& attachments,
- const AttachmentStore::WriteCallback& callback) {
- DCHECK(CalledOnValidThread());
- backend_task_runner_->PostTask(
- FROM_HERE, base::Bind(&AttachmentStoreBackend::Write,
- base::Unretained(backend_.get()), component,
- attachments, callback));
-}
-
-void AttachmentStoreFrontend::SetReference(AttachmentStore::Component component,
- const AttachmentIdList& ids) {
- DCHECK(CalledOnValidThread());
- backend_task_runner_->PostTask(
- FROM_HERE, base::Bind(&AttachmentStoreBackend::SetReference,
- base::Unretained(backend_.get()), component, ids));
-}
-
-void AttachmentStoreFrontend::DropReference(
- AttachmentStore::Component component,
- const AttachmentIdList& ids,
- const AttachmentStore::DropCallback& callback) {
- DCHECK(CalledOnValidThread());
- backend_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&AttachmentStoreBackend::DropReference,
- base::Unretained(backend_.get()), component, ids, callback));
-}
-
-void AttachmentStoreFrontend::ReadMetadataById(
- AttachmentStore::Component component,
- const AttachmentIdList& ids,
- const AttachmentStore::ReadMetadataCallback& callback) {
- DCHECK(CalledOnValidThread());
- backend_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&AttachmentStoreBackend::ReadMetadataById,
- base::Unretained(backend_.get()), component, ids, callback));
-}
-
-void AttachmentStoreFrontend::ReadMetadata(
- AttachmentStore::Component component,
- const AttachmentStore::ReadMetadataCallback& callback) {
- DCHECK(CalledOnValidThread());
- backend_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&AttachmentStoreBackend::ReadMetadata,
- base::Unretained(backend_.get()), component, callback));
-}
-
-} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698