OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_STORE_ADD_URLS_STORE_COMMAND_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_STORE_ADD_URLS_STORE_COMMAND_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/callback.h" |
| 12 #include "base/macros.h" |
| 13 #include "components/offline_pages/core/prefetch/prefetch_types.h" |
| 14 |
| 15 namespace offline_pages { |
| 16 |
| 17 // Adds new entries to the store representing new suggestions of pages to be |
| 18 // prefecthed. |
| 19 class AddUrlsStoreCommand { |
| 20 public: |
| 21 using UrlsAddedCallback = base::OnceCallback<void(bool success)>; |
| 22 |
| 23 AddUrlsStoreCommand(){}; |
| 24 virtual ~AddUrlsStoreCommand(){}; |
| 25 |
| 26 // Adds new entries using the URLs and client IDs from |prefetch_urls| into |
| 27 // the assigned client |name_space|. Will run |callback| when done with the |
| 28 // final |success| result. |
| 29 virtual void Execute(const std::string& name_space, |
| 30 const std::vector<PrefetchURL>& prefetch_urls, |
| 31 UrlsAddedCallback callback) = 0; |
| 32 |
| 33 private: |
| 34 DISALLOW_COPY_AND_ASSIGN(AddUrlsStoreCommand); |
| 35 }; |
| 36 |
| 37 } // namespace offline_pages |
| 38 |
| 39 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_STORE_ADD_URLS_STORE_COMMAND_H
_ |
OLD | NEW |