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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profiles/profile_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 15 matching lines...) Expand all
26 #include "chrome/browser/extensions/extension_protocols.h" 26 #include "chrome/browser/extensions/extension_protocols.h"
27 #include "chrome/browser/extensions/extension_resource_protocols.h" 27 #include "chrome/browser/extensions/extension_resource_protocols.h"
28 #include "chrome/browser/extensions/extension_system.h" 28 #include "chrome/browser/extensions/extension_system.h"
29 #include "chrome/browser/io_thread.h" 29 #include "chrome/browser/io_thread.h"
30 #include "chrome/browser/net/chrome_cookie_notification_details.h" 30 #include "chrome/browser/net/chrome_cookie_notification_details.h"
31 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" 31 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h"
32 #include "chrome/browser/net/chrome_net_log.h" 32 #include "chrome/browser/net/chrome_net_log.h"
33 #include "chrome/browser/net/chrome_network_delegate.h" 33 #include "chrome/browser/net/chrome_network_delegate.h"
34 #include "chrome/browser/net/http_server_properties_manager.h" 34 #include "chrome/browser/net/http_server_properties_manager.h"
35 #include "chrome/browser/net/proxy_service_factory.h" 35 #include "chrome/browser/net/proxy_service_factory.h"
36 #include "chrome/browser/net/resource_prefetch_predictor_observer.h"
36 #include "chrome/browser/net/transport_security_persister.h" 37 #include "chrome/browser/net/transport_security_persister.h"
37 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 38 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
38 #include "chrome/browser/policy/url_blacklist_manager.h" 39 #include "chrome/browser/policy/url_blacklist_manager.h"
40 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
41 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
39 #include "chrome/browser/prefs/pref_service.h" 42 #include "chrome/browser/prefs/pref_service.h"
40 #include "chrome/browser/profiles/profile.h" 43 #include "chrome/browser/profiles/profile.h"
41 #include "chrome/browser/profiles/profile_manager.h" 44 #include "chrome/browser/profiles/profile_manager.h"
42 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" 45 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h"
43 #include "chrome/common/chrome_notification_types.h" 46 #include "chrome/common/chrome_notification_types.h"
44 #include "chrome/common/chrome_switches.h" 47 #include "chrome/common/chrome_switches.h"
45 #include "chrome/common/pref_names.h" 48 #include "chrome/common/pref_names.h"
46 #include "chrome/common/url_constants.h" 49 #include "chrome/common/url_constants.h"
47 #include "content/public/browser/browser_thread.h" 50 #include "content/public/browser/browser_thread.h"
48 #include "content/public/browser/host_zoom_map.h" 51 #include "content/public/browser/host_zoom_map.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); 196 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile);
194 params->ssl_config_service = profile->GetSSLConfigService(); 197 params->ssl_config_service = profile->GetSSLConfigService();
195 base::Callback<Profile*(void)> profile_getter = 198 base::Callback<Profile*(void)> profile_getter =
196 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), 199 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(),
197 profile); 200 profile);
198 params->cookie_monster_delegate = 201 params->cookie_monster_delegate =
199 new ChromeCookieMonsterDelegate(profile_getter); 202 new ChromeCookieMonsterDelegate(profile_getter);
200 params->extension_info_map = 203 params->extension_info_map =
201 ExtensionSystem::Get(profile)->info_map(); 204 ExtensionSystem::Get(profile)->info_map();
202 205
206 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.
207 resource_prefetch_predictor_observer_.reset(
208 new chrome_browser_net::ResourcePrefetchPredictorObserver(
209 predictors::ResourcePrefetchPredictorFactory::GetForProfile(
210 profile)));
211 }
212
203 #if defined(ENABLE_NOTIFICATIONS) 213 #if defined(ENABLE_NOTIFICATIONS)
204 params->notification_service = 214 params->notification_service =
205 DesktopNotificationServiceFactory::GetForProfile(profile); 215 DesktopNotificationServiceFactory::GetForProfile(profile);
206 #endif 216 #endif
207 217
208 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); 218 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry();
209 219
210 ChromeProxyConfigService* proxy_config_service = 220 ChromeProxyConfigService* proxy_config_service =
211 ProxyServiceFactory::CreateProxyConfigService(true); 221 ProxyServiceFactory::CreateProxyConfigService(true);
212 params->proxy_config_service.reset(proxy_config_service); 222 params->proxy_config_service.reset(proxy_config_service);
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 // Take ownership over these parameters. 556 // Take ownership over these parameters.
547 cookie_settings_ = profile_params_->cookie_settings; 557 cookie_settings_ = profile_params_->cookie_settings;
548 #if defined(ENABLE_NOTIFICATIONS) 558 #if defined(ENABLE_NOTIFICATIONS)
549 notification_service_ = profile_params_->notification_service; 559 notification_service_ = profile_params_->notification_service;
550 #endif 560 #endif
551 extension_info_map_ = profile_params_->extension_info_map; 561 extension_info_map_ = profile_params_->extension_info_map;
552 562
553 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); 563 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get();
554 resource_context_->request_context_ = main_request_context_.get(); 564 resource_context_->request_context_ = main_request_context_.get();
555 565
566 if (profile_params_->resource_prefetch_predictor_observer_.get())
567 resource_prefetch_predictor_observer_.reset(
568 profile_params_->resource_prefetch_predictor_observer_.release());
569
556 LazyInitializeInternal(profile_params_.get()); 570 LazyInitializeInternal(profile_params_.get());
557 571
558 profile_params_.reset(); 572 profile_params_.reset();
559 initialized_ = true; 573 initialized_ = true;
560 } 574 }
561 575
562 void ProfileIOData::ApplyProfileParamsToContext( 576 void ProfileIOData::ApplyProfileParamsToContext(
563 ChromeURLRequestContext* context) const { 577 ChromeURLRequestContext* context) const {
564 context->set_is_incognito(is_incognito()); 578 context->set_is_incognito(is_incognito());
565 context->set_accept_language(profile_params_->accept_language); 579 context->set_accept_language(profile_params_->accept_language);
(...skipping 21 matching lines...) Expand all
587 } 601 }
588 602
589 void ProfileIOData::set_server_bound_cert_service( 603 void ProfileIOData::set_server_bound_cert_service(
590 net::ServerBoundCertService* server_bound_cert_service) const { 604 net::ServerBoundCertService* server_bound_cert_service) const {
591 server_bound_cert_service_.reset(server_bound_cert_service); 605 server_bound_cert_service_.reset(server_bound_cert_service);
592 } 606 }
593 607
594 void ProfileIOData::DestroyResourceContext() { 608 void ProfileIOData::DestroyResourceContext() {
595 resource_context_.reset(); 609 resource_context_.reset();
596 } 610 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698