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

Unified Diff: components/download/internal/test/noop_store.cc

Issue 2881173003: Download Service : Added leveldb proto layer (Closed)
Patch Set: more comments Created 3 years, 7 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/download/internal/test/noop_store.cc
diff --git a/components/download/internal/noop_store.cc b/components/download/internal/test/noop_store.cc
similarity index 52%
rename from components/download/internal/noop_store.cc
rename to components/download/internal/test/noop_store.cc
index 42785cbc5b191709ce78182dc5565882fc269c1f..b20993cfc3724ff595ce13537c6142882f9f2831 100644
--- a/components/download/internal/noop_store.cc
+++ b/components/download/internal/test/noop_store.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/download/internal/noop_store.h"
+#include "components/download/internal/test/noop_store.h"
#include "base/bind.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -18,36 +18,35 @@ bool NoopStore::IsInitialized() {
return initialized_;
}
-void NoopStore::Initialize(InitCallback callback) {
+void NoopStore::Initialize(const InitCallback& callback) {
DCHECK(!IsInitialized());
base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE,
- base::BindOnce(&NoopStore::OnInitFinished, weak_ptr_factory_.GetWeakPtr(),
- std::move(callback)));
+ FROM_HERE, base::Bind(&NoopStore::OnInitFinished,
+ weak_ptr_factory_.GetWeakPtr(), callback));
}
-void NoopStore::Destroy(StoreCallback callback) {
+void NoopStore::Destroy(const StoreCallback& callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::BindOnce(std::move(callback), true /** success */));
+ FROM_HERE, base::Bind(callback, true /** success */));
}
-void NoopStore::Update(const Entry& entry, StoreCallback callback) {
+void NoopStore::Update(const Entry& entry, const StoreCallback& callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::BindOnce(std::move(callback), true /** success */));
+ FROM_HERE, base::Bind(callback, true /** success */));
}
-void NoopStore::Remove(const std::string& guid, StoreCallback callback) {
+void NoopStore::Remove(const std::string& guid, const StoreCallback& callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::BindOnce(std::move(callback), true /** success */));
+ FROM_HERE, base::Bind(callback, true /** success */));
}
-void NoopStore::OnInitFinished(InitCallback callback) {
+void NoopStore::OnInitFinished(const InitCallback& callback) {
initialized_ = true;
std::unique_ptr<std::vector<Entry>> entries =
base::MakeUnique<std::vector<Entry>>();
- std::move(callback).Run(true /** success */, std::move(entries));
+ callback.Run(true /** success */, std::move(entries));
}
} // namespace download

Powered by Google App Engine
This is Rietveld 408576698