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

Unified Diff: components/download/internal/store.h

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/store.h
diff --git a/components/download/internal/store.h b/components/download/internal/store.h
index 04a39bffcc6ee7b0cab733d46cbe90bbd32d8af6..06cf6ce2ceee26b3e00aae6b67594cb5b3447841 100644
--- a/components/download/internal/store.h
+++ b/components/download/internal/store.h
@@ -10,8 +10,6 @@
#include <vector>
#include "base/callback_forward.h"
-#include "base/memory/ref_counted.h"
-#include "base/sequenced_task_runner.h"
namespace download {
@@ -21,9 +19,9 @@ struct Entry;
class Store {
public:
using InitCallback =
- base::OnceCallback<void(bool success,
- std::unique_ptr<std::vector<Entry>> entries)>;
- using StoreCallback = base::OnceCallback<void(bool success)>;
+ base::Callback<void(bool success,
+ std::unique_ptr<std::vector<Entry>> entries)>;
+ using StoreCallback = base::Callback<void(bool success)>;
virtual ~Store() = default;
@@ -34,19 +32,20 @@ class Store {
// Initializes this Store and asynchronously returns whether or not that
// initialization was successful as well as a list of Entry objects from the
// Store.
- virtual void Initialize(InitCallback callback) = 0;
+ virtual void Initialize(const InitCallback& callback) = 0;
// Destroyes the store and asynchronously returns whether or not that
// destruction was successful.
- virtual void Destroy(StoreCallback callback) = 0;
+ virtual void Destroy(const StoreCallback& callback) = 0;
David Trainor- moved to gerrit 2017/05/24 15:31:21 Let's remove this... I think I misunderstood what
shaktisahu 2017/05/24 18:29:01 Yes, this would delete the database. Removed.
// Adds or updates |entry| in this Store asynchronously and returns whether or
// not that was successful.
- virtual void Update(const Entry& entry, StoreCallback callback) = 0;
+ virtual void Update(const Entry& entry, const StoreCallback& callback) = 0;
// Removes the Entry associated with |guid| from this Store asynchronously and
// returns whether or not that was successful.
- virtual void Remove(const std::string& guid, StoreCallback callback) = 0;
+ virtual void Remove(const std::string& guid,
+ const StoreCallback& callback) = 0;
};
} // namespace download
« no previous file with comments | « components/download/internal/proto_conversions_unittest.cc ('k') | components/download/internal/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698