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

Unified Diff: components/offline_pages/core/prefetch/add_unique_urls_task.h

Issue 2920083002: Prefetching: Introduce store commands abstractions to be used by tasks. (Closed)
Patch Set: Added TODO for NWake Created 3 years, 6 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/offline_pages/core/prefetch/add_unique_urls_task.h
diff --git a/components/offline_pages/core/prefetch/add_unique_urls_task.h b/components/offline_pages/core/prefetch/add_unique_urls_task.h
index c7a116131b057ad8ab9cf5f29e44cb57fc333c24..3d9f9e57cc5f6c20eae89f109922c1e9457c3352 100644
--- a/components/offline_pages/core/prefetch/add_unique_urls_task.h
+++ b/components/offline_pages/core/prefetch/add_unique_urls_task.h
@@ -5,13 +5,14 @@
#ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_ADD_UNIQUE_URLS_TASK_H_
#define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_ADD_UNIQUE_URLS_TASK_H_
+#include <string>
#include <vector>
#include "base/memory/weak_ptr.h"
-#include "components/offline_pages/core/prefetch/prefetch_store.h"
#include "components/offline_pages/core/prefetch/prefetch_types.h"
+#include "components/offline_pages/core/prefetch/store/add_urls_store_command.h"
+#include "components/offline_pages/core/prefetch/store/cleanup_zombies_store_command.h"
#include "components/offline_pages/core/task.h"
-#include "url/gurl.h"
namespace offline_pages {
@@ -26,14 +27,21 @@ namespace offline_pages {
// from the store.
class AddUniqueUrlsTask : public Task {
public:
- AddUniqueUrlsTask(PrefetchStore* store,
- const std::vector<PrefetchURL>& prefetch_urls);
+ AddUniqueUrlsTask(
+ std::unique_ptr<AddUrlsStoreCommand> add_urls_command,
+ std::unique_ptr<CleanupZombiesStoreCommand> zombies_cleanup_command,
+ const std::string& name_space,
+ const std::vector<PrefetchURL>& prefetch_urls);
~AddUniqueUrlsTask() override;
void Run() override;
private:
- PrefetchStore* prefetch_store_;
+ void OnUrlsAdded(bool success);
+
+ std::unique_ptr<AddUrlsStoreCommand> add_urls_command_;
+ std::unique_ptr<CleanupZombiesStoreCommand> zombies_cleanup_command_;
+ const std::string& name_space_;
std::vector<PrefetchURL> prefetch_urls_;
base::WeakPtrFactory<AddUniqueUrlsTask> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698