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

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: Fixing enum name. 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); 194 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile);
192 params->ssl_config_service = profile->GetSSLConfigService(); 195 params->ssl_config_service = profile->GetSSLConfigService();
193 base::Callback<Profile*(void)> profile_getter = 196 base::Callback<Profile*(void)> profile_getter =
194 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), 197 base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(),
195 profile); 198 profile);
196 params->cookie_monster_delegate = 199 params->cookie_monster_delegate =
197 new ChromeCookieMonsterDelegate(profile_getter); 200 new ChromeCookieMonsterDelegate(profile_getter);
198 params->extension_info_map = 201 params->extension_info_map =
199 ExtensionSystem::Get(profile)->info_map(); 202 ExtensionSystem::Get(profile)->info_map();
200 203
204 if (predictors::ResourcePrefetchPredictor* predictor =
205 predictors::ResourcePrefetchPredictorFactory::GetForProfile(
206 profile))
207 resource_prefetch_predictor_observer_.reset(
willchan no longer on Chromium 2012/06/18 20:15:12 Ditto here on the braces.
Shishir 2012/06/18 20:38:33 Done.
208 new chrome_browser_net::ResourcePrefetchPredictorObserver(predictor));
209
201 #if defined(ENABLE_NOTIFICATIONS) 210 #if defined(ENABLE_NOTIFICATIONS)
202 params->notification_service = 211 params->notification_service =
203 DesktopNotificationServiceFactory::GetForProfile(profile); 212 DesktopNotificationServiceFactory::GetForProfile(profile);
204 #endif 213 #endif
205 214
206 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); 215 params->protocol_handler_registry = profile->GetProtocolHandlerRegistry();
207 216
208 ChromeProxyConfigService* proxy_config_service = 217 ChromeProxyConfigService* proxy_config_service =
209 ProxyServiceFactory::CreateProxyConfigService(true); 218 ProxyServiceFactory::CreateProxyConfigService(true);
210 params->proxy_config_service.reset(proxy_config_service); 219 params->proxy_config_service.reset(proxy_config_service);
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 // Take ownership over these parameters. 552 // Take ownership over these parameters.
544 cookie_settings_ = profile_params_->cookie_settings; 553 cookie_settings_ = profile_params_->cookie_settings;
545 #if defined(ENABLE_NOTIFICATIONS) 554 #if defined(ENABLE_NOTIFICATIONS)
546 notification_service_ = profile_params_->notification_service; 555 notification_service_ = profile_params_->notification_service;
547 #endif 556 #endif
548 extension_info_map_ = profile_params_->extension_info_map; 557 extension_info_map_ = profile_params_->extension_info_map;
549 558
550 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); 559 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get();
551 resource_context_->request_context_ = main_request_context_.get(); 560 resource_context_->request_context_ = main_request_context_.get();
552 561
562 if (profile_params_->resource_prefetch_predictor_observer_.get())
563 resource_prefetch_predictor_observer_.reset(
willchan no longer on Chromium 2012/06/18 20:15:12 Check the Chromium style guide, you should be usin
Shishir 2012/06/18 20:38:33 Done.
564 profile_params_->resource_prefetch_predictor_observer_.release());
565
553 LazyInitializeInternal(profile_params_.get()); 566 LazyInitializeInternal(profile_params_.get());
554 567
555 profile_params_.reset(); 568 profile_params_.reset();
556 initialized_ = true; 569 initialized_ = true;
557 } 570 }
558 571
559 void ProfileIOData::ApplyProfileParamsToContext( 572 void ProfileIOData::ApplyProfileParamsToContext(
560 ChromeURLRequestContext* context) const { 573 ChromeURLRequestContext* context) const {
561 context->set_is_incognito(is_incognito()); 574 context->set_is_incognito(is_incognito());
562 context->set_accept_language(profile_params_->accept_language); 575 context->set_accept_language(profile_params_->accept_language);
(...skipping 20 matching lines...) Expand all
583 } 596 }
584 597
585 void ProfileIOData::set_server_bound_cert_service( 598 void ProfileIOData::set_server_bound_cert_service(
586 net::ServerBoundCertService* server_bound_cert_service) const { 599 net::ServerBoundCertService* server_bound_cert_service) const {
587 server_bound_cert_service_.reset(server_bound_cert_service); 600 server_bound_cert_service_.reset(server_bound_cert_service);
588 } 601 }
589 602
590 void ProfileIOData::DestroyResourceContext() { 603 void ProfileIOData::DestroyResourceContext() {
591 resource_context_.reset(); 604 resource_context_.reset();
592 } 605 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698