Index: components/offline_pages/core/prefetch/store/add_urls_store_command.h |
diff --git a/components/offline_pages/core/prefetch/store/add_urls_store_command.h b/components/offline_pages/core/prefetch/store/add_urls_store_command.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..635979439647533dcf7aa593629bc040a16b4663 |
--- /dev/null |
+++ b/components/offline_pages/core/prefetch/store/add_urls_store_command.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2017 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_OFFLINE_PAGES_CORE_PREFETCH_STORE_ADD_URLS_STORE_COMMAND_H_ |
+#define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_STORE_ADD_URLS_STORE_COMMAND_H_ |
+ |
+#include <string> |
+#include <vector> |
+ |
+#include "base/callback.h" |
+#include "base/macros.h" |
+#include "components/offline_pages/core/prefetch/prefetch_types.h" |
+ |
+namespace offline_pages { |
+ |
+// Adds new entries to the store representing new suggestions of pages to be |
+// prefecthed. |
+class AddUrlsStoreCommand { |
+ public: |
+ using UrlsAddedCallback = base::OnceCallback<void(bool success)>; |
+ |
+ AddUrlsStoreCommand(){}; |
+ virtual ~AddUrlsStoreCommand(){}; |
+ |
+ // Adds new entries using the URLs and client IDs from |prefetch_urls| into |
+ // the assigned client |name_space|. Will run |callback| when done with the |
+ // final |success| result. |
+ virtual void Execute(const std::string& name_space, |
+ const std::vector<PrefetchURL>& prefetch_urls, |
+ UrlsAddedCallback callback) = 0; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(AddUrlsStoreCommand); |
+}; |
+ |
+} // namespace offline_pages |
+ |
+#endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_STORE_ADD_URLS_STORE_COMMAND_H_ |