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

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

Issue 2762673002: predictors: Pass manifests from Bork to store in ResourcePrefetchPredictor. (Closed)
Patch Set: Rebase. 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..dc9c5def3bcc8dceec14b325aef1cfe04287276e 100644
--- a/components/precache/content/precache_manager.cc
+++ b/components/precache/content/precache_manager.cc
@@ -20,7 +20,9 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h"
#include "components/history/core/browser/history_service.h"
#include "components/precache/core/precache_database.h"
+#include "components/precache/core/precache_manifest_delegate.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 +64,14 @@ PrecacheManager::PrecacheManager(
const history::HistoryService* const history_service,
const data_reduction_proxy::DataReductionProxySettings*
data_reduction_proxy_settings,
+ PrecacheManifestDelegate* precache_manifest_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),
+ precache_manifest_delegate_(precache_manifest_delegate),
is_precaching_(false) {
precache_database_ = std::move(precache_database);
BrowserThread::PostTask(
@@ -456,6 +460,13 @@ void PrecacheManager::OnDone() {
is_precaching_ = false;
}
+void PrecacheManager::OnManifestFetched(const std::string& host,
+ const PrecacheManifest& manifest) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ if (precache_manifest_delegate_)
+ precache_manifest_delegate_->OnManifestFetched(host, manifest);
+}
+
void PrecacheManager::OnHostsReceived(
const history::TopHostsList& host_counts) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);

Powered by Google App Engine
This is Rietveld 408576698