| Index: components/offline_pages/core/prefetch/prefetch_dispatcher.h
|
| diff --git a/components/offline_pages/core/prefetch/prefetch_dispatcher.h b/components/offline_pages/core/prefetch/prefetch_dispatcher.h
|
| index 36f9b206de3b4931cd2951798012fbeac27d9977..0e8850faf619c27b3c7d6c2ff4f560ddec3319cb 100644
|
| --- a/components/offline_pages/core/prefetch/prefetch_dispatcher.h
|
| +++ b/components/offline_pages/core/prefetch/prefetch_dispatcher.h
|
| @@ -11,8 +11,7 @@
|
| #include "base/memory/weak_ptr.h"
|
| #include "components/offline_pages/core/offline_page_item.h"
|
| #include "components/offline_pages/core/prefetch/prefetch_dispatcher.h"
|
| -
|
| -class GURL;
|
| +#include "components/offline_pages/core/prefetch/prefetch_types.h"
|
|
|
| namespace offline_pages {
|
|
|
| @@ -21,16 +20,6 @@ namespace offline_pages {
|
| // and manage their execution and inter-dependencies.
|
| class PrefetchDispatcher {
|
| public:
|
| - struct PrefetchURL {
|
| - // Used to differentiate URLs from different sources. |name_space| should
|
| - // be unique per source. |id| can be anything useful to identify the page,
|
| - // but will not be used for deduplication.
|
| - ClientId client_id;
|
| -
|
| - // This URL will be prefetched by the system.
|
| - GURL url;
|
| - };
|
| -
|
| // A |ScopedBackgroundTask| is created when we are running in a background
|
| // task. Destroying this object should notify the system that we are done
|
| // processing the background task.
|
| @@ -46,9 +35,11 @@ class PrefetchDispatcher {
|
|
|
| virtual ~PrefetchDispatcher() = default;
|
|
|
| - // Called when a consumer has candidate URLs for the system to prefetch.
|
| - // Duplicates are accepted by the PrefetchDispatcher but ignored.
|
| + // Called when a client has candidate URLs for the system to prefetch, along
|
| + // with the client's unique namespace. URLs that are currently in the system
|
| + // for this client are acceptable but ignored.
|
| virtual void AddCandidatePrefetchURLs(
|
| + const std::string& name_space,
|
| const std::vector<PrefetchURL>& prefetch_urls) = 0;
|
|
|
| // Called when all existing suggestions are no longer considered valid for a
|
| @@ -59,7 +50,8 @@ class PrefetchDispatcher {
|
|
|
| // Called to invalidate a single PrefetchURL entry identified by |client_id|.
|
| // If multiple have the same |client_id|, they will all be removed.
|
| - virtual void RemovePrefetchURLsByClientId(const ClientId& client_id) = 0;
|
| + virtual void RemovePrefetchURLsByClientId(const std::string& name_space,
|
| + const std::string& client_id) = 0;
|
|
|
| // Called when Android OS has scheduled us for background work. When
|
| // destroyed, |task| will call back and inform the OS that we are done work
|
|
|