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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 462423004: Revert CL 117933003. Re-add resource speculative prefetching code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase to fix patch failure Created 6 years, 3 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: chrome/browser/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index c61fda3fd565248db0cc628ae2b09d06cdec14bb..5608a3672b987df3ad504da82a8a3759155b38d7 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -42,6 +42,9 @@
#include "chrome/browser/net/chrome_url_request_context_getter.h"
#include "chrome/browser/net/cookie_store_util.h"
#include "chrome/browser/net/proxy_service_factory.h"
+#include "chrome/browser/net/resource_prefetch_predictor_observer.h"
+#include "chrome/browser/predictors/resource_prefetch_predictor.h"
+#include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/signin_names_io_thread.h"
@@ -357,6 +360,13 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
extensions::ExtensionSystem::Get(profile)->info_map();
#endif
+ if (predictors::ResourcePrefetchPredictor* predictor =
+ predictors::ResourcePrefetchPredictorFactory::GetForProfile(
+ profile)) {
+ resource_prefetch_predictor_observer_.reset(
+ new chrome_browser_net::ResourcePrefetchPredictorObserver(predictor));
+ }
+
ProtocolHandlerRegistry* protocol_handler_registry =
ProtocolHandlerRegistryFactory::GetForBrowserContext(profile);
DCHECK(protocol_handler_registry);
@@ -1054,6 +1064,11 @@ void ProfileIOData::Init(
resource_context_->host_resolver_ = io_thread_globals->host_resolver.get();
resource_context_->request_context_ = main_request_context_.get();
+ if (profile_params_->resource_prefetch_predictor_observer_) {
+ resource_prefetch_predictor_observer_.reset(
+ profile_params_->resource_prefetch_predictor_observer_.release());
+ }
+
#if defined(ENABLE_MANAGED_USERS)
supervised_user_url_filter_ = profile_params_->supervised_user_url_filter;
#endif
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698