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

Side by Side Diff: components/offline_pages/core/prefetch/store/add_urls_store_command.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 unified diff | Download patch
OLDNEW
(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 _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698