| Index: components/precache/content/precache_manager.h
|
| diff --git a/components/precache/content/precache_manager.h b/components/precache/content/precache_manager.h
|
| index afd5e6c6e737de5006cfab24431c96ad684654da..3f678e9fcab99d7b4821fb42439692cc803dc2e9 100644
|
| --- a/components/precache/content/precache_manager.h
|
| +++ b/components/precache/content/precache_manager.h
|
| @@ -55,6 +55,7 @@ namespace precache {
|
|
|
| class PrecacheDatabase;
|
| class PrecacheUnfinishedWork;
|
| +class PrecacheManifest;
|
|
|
| extern const char kPrecacheFieldTrialName[];
|
|
|
| @@ -73,6 +74,13 @@ class PrecacheManager : public KeyedService,
|
| public PrecacheFetcher::PrecacheDelegate,
|
| public base::SupportsWeakPtr<PrecacheManager> {
|
| public:
|
| + class Delegate {
|
| + public:
|
| + // Called when a precache manifest has been successfully fetched and parsed.
|
| + virtual void OnManifestFetched(const std::string& host,
|
| + const PrecacheManifest& manifest) = 0;
|
| + };
|
| +
|
| typedef base::Callback<void(bool)> PrecacheCompletionCallback;
|
|
|
| PrecacheManager(content::BrowserContext* browser_context,
|
| @@ -80,6 +88,7 @@ class PrecacheManager : public KeyedService,
|
| const history::HistoryService* history_service,
|
| const data_reduction_proxy::DataReductionProxySettings*
|
| data_reduction_proxy_settings,
|
| + Delegate* delegate,
|
| const base::FilePath& db_path,
|
| std::unique_ptr<PrecacheDatabase> precache_database);
|
| ~PrecacheManager() override;
|
| @@ -153,6 +162,8 @@ class PrecacheManager : public KeyedService,
|
|
|
| // From PrecacheFetcher::PrecacheDelegate.
|
| void OnDone() override;
|
| + void OnManifestFetched(const std::string& host,
|
| + const PrecacheManifest& manifest) override;
|
|
|
| // Registers the precache synthetic field trial for users whom the precache
|
| // task was run recently. |last_precache_time| is the last time precache task
|
| @@ -219,6 +230,10 @@ class PrecacheManager : public KeyedService,
|
| const data_reduction_proxy::DataReductionProxySettings* const
|
| data_reduction_proxy_settings_;
|
|
|
| + // The Delegate corresponding to the browser context. Used to notify the
|
| + // browser about a new available manifest. May be null.
|
| + Delegate* delegate_;
|
| +
|
| // The PrecacheFetcher used to precache resources. Should only be used on the
|
| // UI thread.
|
| std::unique_ptr<PrecacheFetcher> precache_fetcher_;
|
|
|