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

Side by Side Diff: components/offline_pages/core/prefetch/prefetch_dispatcher.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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_H_
6 #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_H_ 6 #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 27 matching lines...) Expand all
38 virtual ~PrefetchDispatcher() = default; 38 virtual ~PrefetchDispatcher() = default;
39 39
40 // Initializes the dispatcher with its respective service instance. This must 40 // Initializes the dispatcher with its respective service instance. This must
41 // be done before any other methods are called. 41 // be done before any other methods are called.
42 virtual void SetService(PrefetchService* service) = 0; 42 virtual void SetService(PrefetchService* service) = 0;
43 43
44 // Called when a client has candidate URLs for the system to prefetch, along 44 // Called when a client has candidate URLs for the system to prefetch, along
45 // with the client's unique namespace. URLs that are currently in the system 45 // with the client's unique namespace. URLs that are currently in the system
46 // for this client are acceptable but ignored. 46 // for this client are acceptable but ignored.
47 virtual void AddCandidatePrefetchURLs( 47 virtual void AddCandidatePrefetchURLs(
48 const std::string& name_space,
48 const std::vector<PrefetchURL>& prefetch_urls) = 0; 49 const std::vector<PrefetchURL>& prefetch_urls) = 0;
49 50
50 // Called when all existing suggestions are no longer considered valid for a 51 // Called when all existing suggestions are no longer considered valid for a
51 // given namespace. The prefetch system should remove any URLs that 52 // given namespace. The prefetch system should remove any URLs that
52 // have not yet started downloading within that namespace. 53 // have not yet started downloading within that namespace.
53 virtual void RemoveAllUnprocessedPrefetchURLs( 54 virtual void RemoveAllUnprocessedPrefetchURLs(
54 const std::string& name_space) = 0; 55 const std::string& name_space) = 0;
55 56
56 // Called to invalidate a single PrefetchURL entry identified by |client_id|. 57 // Called to invalidate a single PrefetchURL entry identified by |client_id|.
57 // If multiple have the same |client_id|, they will all be removed. 58 // If multiple have the same |client_id|, they will all be removed.
(...skipping 15 matching lines...) Expand all
73 virtual void GCMOperationCompletedMessageReceived( 74 virtual void GCMOperationCompletedMessageReceived(
74 const std::string& operation_name) = 0; 75 const std::string& operation_name) = 0;
75 76
76 // Used by the test to signal the completion of the background task. 77 // Used by the test to signal the completion of the background task.
77 virtual void RequestFinishBackgroundTaskForTest() = 0; 78 virtual void RequestFinishBackgroundTaskForTest() = 0;
78 }; 79 };
79 80
80 } // namespace offline_pages 81 } // namespace offline_pages
81 82
82 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_H_ 83 #endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698