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

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

Issue 10416002: Seculative resource prefetching for URLs CL. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Moving to WeakPtrs and RVHD. Created 8 years, 7 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 8b513bbe366b65ffc2f7709c47b615514b39414a..72a81e80310a9ecd2a11af46d542091ed384972c 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -33,9 +33,12 @@
#include "chrome/browser/net/chrome_network_delegate.h"
#include "chrome/browser/net/http_server_properties_manager.h"
#include "chrome/browser/net/proxy_service_factory.h"
+#include "chrome/browser/net/resource_prefetch_predictor_observer.h"
#include "chrome/browser/net/transport_security_persister.h"
#include "chrome/browser/notifications/desktop_notification_service_factory.h"
#include "chrome/browser/policy/url_blacklist_manager.h"
+#include "chrome/browser/predictors/resource_prefetch_predictor.h"
+#include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -200,6 +203,13 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
params->extension_info_map =
ExtensionSystem::Get(profile)->info_map();
+ if (predictors::ResourcePrefetchPredictorFactory::GetForProfile(profile)) {
dominich 2012/05/30 15:35:01 nit: if (predictors::ResourcePrefetchPredictor* p
Shishir 2012/05/30 18:07:15 Done.
+ resource_prefetch_predictor_observer_.reset(
+ new chrome_browser_net::ResourcePrefetchPredictorObserver(
+ predictors::ResourcePrefetchPredictorFactory::GetForProfile(
+ profile)));
+ }
+
#if defined(ENABLE_NOTIFICATIONS)
params->notification_service =
DesktopNotificationServiceFactory::GetForProfile(profile);
@@ -553,6 +563,10 @@ void ProfileIOData::LazyInitialize() const {
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_.get())
+ resource_prefetch_predictor_observer_.reset(
+ profile_params_->resource_prefetch_predictor_observer_.release());
+
LazyInitializeInternal(profile_params_.get());
profile_params_.reset();

Powered by Google App Engine
This is Rietveld 408576698