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

Unified Diff: components/precache/content/precache_manager.cc

Issue 2762673002: predictors: Pass manifests from Bork to store in ResourcePrefetchPredictor. (Closed)
Patch Set: Add delegate tests for PrecacheFetcher. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: components/precache/content/precache_manager.cc
diff --git a/components/precache/content/precache_manager.cc b/components/precache/content/precache_manager.cc
index c28cb53aafe3cfa8aa7baa81aa3f74de94627fe6..e758a4bbbcc88dc3f75b82ef72c3f5446cca1eac 100644
--- a/components/precache/content/precache_manager.cc
+++ b/components/precache/content/precache_manager.cc
@@ -21,6 +21,7 @@
#include "components/history/core/browser/history_service.h"
#include "components/precache/core/precache_database.h"
#include "components/precache/core/precache_switches.h"
+#include "components/precache/core/proto/precache.pb.h"
#include "components/precache/core/proto/unfinished_work.pb.h"
#include "components/prefs/pref_service.h"
#include "components/sync/driver/sync_service.h"
@@ -62,12 +63,14 @@ PrecacheManager::PrecacheManager(
const history::HistoryService* const history_service,
const data_reduction_proxy::DataReductionProxySettings*
data_reduction_proxy_settings,
+ Delegate* delegate,
const base::FilePath& db_path,
std::unique_ptr<PrecacheDatabase> precache_database)
: browser_context_(browser_context),
sync_service_(sync_service),
history_service_(history_service),
data_reduction_proxy_settings_(data_reduction_proxy_settings),
+ delegate_(delegate),
is_precaching_(false) {
precache_database_ = std::move(precache_database);
BrowserThread::PostTask(
@@ -456,6 +459,13 @@ void PrecacheManager::OnDone() {
is_precaching_ = false;
}
+void PrecacheManager::OnManifestFetched(const std::string& host,
+ const PrecacheManifest& manifest) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ if (delegate_)
+ delegate_->OnManifestFetched(host, manifest);
+}
+
void PrecacheManager::OnHostsReceived(
const history::TopHostsList& host_counts) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
« no previous file with comments | « components/precache/content/precache_manager.h ('k') | components/precache/content/precache_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698