| OLD | NEW | 
|---|
| 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 <stddef.h> | 7 #include <stddef.h> | 
| 8 | 8 | 
| 9 #include <string> | 9 #include <string> | 
| 10 #include <utility> | 10 #include <utility> | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
| 32 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 32 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 
| 33 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 33 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 
| 34 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 34 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 
| 35 #include "chrome/browser/devtools/devtools_network_controller.h" | 35 #include "chrome/browser/devtools/devtools_network_controller.h" | 
| 36 #include "chrome/browser/devtools/devtools_network_transaction_factory.h" | 36 #include "chrome/browser/devtools/devtools_network_transaction_factory.h" | 
| 37 #include "chrome/browser/io_thread.h" | 37 #include "chrome/browser/io_thread.h" | 
| 38 #include "chrome/browser/net/chrome_http_user_agent_settings.h" | 38 #include "chrome/browser/net/chrome_http_user_agent_settings.h" | 
| 39 #include "chrome/browser/net/chrome_network_delegate.h" | 39 #include "chrome/browser/net/chrome_network_delegate.h" | 
| 40 #include "chrome/browser/net/chrome_url_request_context_getter.h" | 40 #include "chrome/browser/net/chrome_url_request_context_getter.h" | 
| 41 #include "chrome/browser/net/loading_predictor_observer.h" | 41 #include "chrome/browser/net/loading_predictor_observer.h" | 
|  | 42 #include "chrome/browser/net/profile_network_context_service.h" | 
|  | 43 #include "chrome/browser/net/profile_network_context_service_factory.h" | 
| 42 #include "chrome/browser/net/proxy_service_factory.h" | 44 #include "chrome/browser/net/proxy_service_factory.h" | 
| 43 #include "chrome/browser/policy/cloud/policy_header_service_factory.h" | 45 #include "chrome/browser/policy/cloud/policy_header_service_factory.h" | 
| 44 #include "chrome/browser/policy/policy_helpers.h" | 46 #include "chrome/browser/policy/policy_helpers.h" | 
| 45 #include "chrome/browser/predictors/loading_predictor.h" | 47 #include "chrome/browser/predictors/loading_predictor.h" | 
| 46 #include "chrome/browser/predictors/loading_predictor_factory.h" | 48 #include "chrome/browser/predictors/loading_predictor_factory.h" | 
| 47 #include "chrome/browser/profiles/net_http_session_params_observer.h" | 49 #include "chrome/browser/profiles/net_http_session_params_observer.h" | 
| 48 #include "chrome/browser/profiles/profile.h" | 50 #include "chrome/browser/profiles/profile.h" | 
| 49 #include "chrome/browser/profiles/profile_manager.h" | 51 #include "chrome/browser/profiles/profile_manager.h" | 
| 50 #include "chrome/browser/ssl/chrome_expect_ct_reporter.h" | 52 #include "chrome/browser/ssl/chrome_expect_ct_reporter.h" | 
| 51 #include "chrome/browser/ui/search/new_tab_page_interceptor_service.h" | 53 #include "chrome/browser/ui/search/new_tab_page_interceptor_service.h" | 
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 383 | 385 | 
| 384 void ProfileIOData::InitializeOnUIThread(Profile* profile) { | 386 void ProfileIOData::InitializeOnUIThread(Profile* profile) { | 
| 385   DCHECK_CURRENTLY_ON(BrowserThread::UI); | 387   DCHECK_CURRENTLY_ON(BrowserThread::UI); | 
| 386   PrefService* pref_service = profile->GetPrefs(); | 388   PrefService* pref_service = profile->GetPrefs(); | 
| 387 | 389 | 
| 388   std::unique_ptr<ProfileParams> params(new ProfileParams); | 390   std::unique_ptr<ProfileParams> params(new ProfileParams); | 
| 389   params->path = profile->GetPath(); | 391   params->path = profile->GetPath(); | 
| 390 | 392 | 
| 391   params->io_thread = g_browser_process->io_thread(); | 393   params->io_thread = g_browser_process->io_thread(); | 
| 392 | 394 | 
|  | 395   ProfileNetworkContextServiceFactory::GetForContext(profile) | 
|  | 396       ->SetUpProfileIODataMainContext(¶ms->main_network_context_request, | 
|  | 397                                       ¶ms->main_network_context_params); | 
|  | 398 | 
| 393   params->cookie_settings = CookieSettingsFactory::GetForProfile(profile); | 399   params->cookie_settings = CookieSettingsFactory::GetForProfile(profile); | 
| 394   params->host_content_settings_map = | 400   params->host_content_settings_map = | 
| 395       HostContentSettingsMapFactory::GetForProfile(profile); | 401       HostContentSettingsMapFactory::GetForProfile(profile); | 
| 396   params->ssl_config_service = profile->GetSSLConfigService(); | 402   params->ssl_config_service = profile->GetSSLConfigService(); | 
| 397 | 403 | 
| 398 #if BUILDFLAG(ENABLE_EXTENSIONS) | 404 #if BUILDFLAG(ENABLE_EXTENSIONS) | 
| 399   params->extension_info_map = | 405   params->extension_info_map = | 
| 400       extensions::ExtensionSystem::Get(profile)->info_map(); | 406       extensions::ExtensionSystem::Get(profile)->info_map(); | 
| 401   params->cookie_monster_delegate = new ExtensionCookieMonsterDelegate(profile); | 407   params->cookie_monster_delegate = new ExtensionCookieMonsterDelegate(profile); | 
| 402 #endif | 408 #endif | 
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 608       use_system_key_slot(false), | 614       use_system_key_slot(false), | 
| 609 #endif | 615 #endif | 
| 610       profile(NULL) { | 616       profile(NULL) { | 
| 611 } | 617 } | 
| 612 | 618 | 
| 613 ProfileIOData::ProfileParams::~ProfileParams() {} | 619 ProfileIOData::ProfileParams::~ProfileParams() {} | 
| 614 | 620 | 
| 615 ProfileIOData::ProfileIOData(Profile::ProfileType profile_type) | 621 ProfileIOData::ProfileIOData(Profile::ProfileType profile_type) | 
| 616     : initialized_(false), | 622     : initialized_(false), | 
| 617 #if defined(OS_CHROMEOS) | 623 #if defined(OS_CHROMEOS) | 
| 618       policy_cert_verifier_(NULL), | 624       policy_cert_verifier_(nullptr), | 
| 619       use_system_key_slot_(false), | 625       use_system_key_slot_(false), | 
| 620 #endif | 626 #endif | 
|  | 627       main_request_context_(nullptr), | 
| 621       resource_context_(new ResourceContext(this)), | 628       resource_context_(new ResourceContext(this)), | 
| 622       profile_type_(profile_type) { | 629       profile_type_(profile_type) { | 
| 623   DCHECK_CURRENTLY_ON(BrowserThread::UI); | 630   DCHECK_CURRENTLY_ON(BrowserThread::UI); | 
| 624 } | 631 } | 
| 625 | 632 | 
| 626 ProfileIOData::~ProfileIOData() { | 633 ProfileIOData::~ProfileIOData() { | 
| 627   if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) | 634   if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) | 
| 628     DCHECK_CURRENTLY_ON(BrowserThread::IO); | 635     DCHECK_CURRENTLY_ON(BrowserThread::IO); | 
| 629 | 636 | 
| 630   // Pull the contents of the request context maps onto the stack for sanity | 637   // Pull the contents of the request context maps onto the stack for sanity | 
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 803     net::CertVerifier* cert_verifier) { | 810     net::CertVerifier* cert_verifier) { | 
| 804   g_cert_verifier_for_testing = cert_verifier; | 811   g_cert_verifier_for_testing = cert_verifier; | 
| 805 } | 812 } | 
| 806 | 813 | 
| 807 content::ResourceContext* ProfileIOData::GetResourceContext() const { | 814 content::ResourceContext* ProfileIOData::GetResourceContext() const { | 
| 808   return resource_context_.get(); | 815   return resource_context_.get(); | 
| 809 } | 816 } | 
| 810 | 817 | 
| 811 net::URLRequestContext* ProfileIOData::GetMainRequestContext() const { | 818 net::URLRequestContext* ProfileIOData::GetMainRequestContext() const { | 
| 812   DCHECK(initialized_); | 819   DCHECK(initialized_); | 
| 813   return main_request_context_.get(); | 820   return main_request_context_; | 
| 814 } | 821 } | 
| 815 | 822 | 
| 816 net::URLRequestContext* ProfileIOData::GetMediaRequestContext() const { | 823 net::URLRequestContext* ProfileIOData::GetMediaRequestContext() const { | 
| 817   DCHECK(initialized_); | 824   DCHECK(initialized_); | 
| 818   net::URLRequestContext* context = AcquireMediaRequestContext(); | 825   net::URLRequestContext* context = AcquireMediaRequestContext(); | 
| 819   DCHECK(context); | 826   DCHECK(context); | 
| 820   return context; | 827   return context; | 
| 821 } | 828 } | 
| 822 | 829 | 
| 823 net::URLRequestContext* ProfileIOData::GetExtensionsRequestContext() const { | 830 net::URLRequestContext* ProfileIOData::GetExtensionsRequestContext() const { | 
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1008   DCHECK(profile_params_.get()); | 1015   DCHECK(profile_params_.get()); | 
| 1009 | 1016 | 
| 1010   IOThread* const io_thread = profile_params_->io_thread; | 1017   IOThread* const io_thread = profile_params_->io_thread; | 
| 1011   IOThread::Globals* const io_thread_globals = io_thread->globals(); | 1018   IOThread::Globals* const io_thread_globals = io_thread->globals(); | 
| 1012 | 1019 | 
| 1013   // Create extension request context.  Only used for cookies. | 1020   // Create extension request context.  Only used for cookies. | 
| 1014   extensions_request_context_.reset(new net::URLRequestContext()); | 1021   extensions_request_context_.reset(new net::URLRequestContext()); | 
| 1015   extensions_request_context_->set_name("extensions"); | 1022   extensions_request_context_->set_name("extensions"); | 
| 1016 | 1023 | 
| 1017   // Create the main request context. | 1024   // Create the main request context. | 
| 1018   net::URLRequestContextBuilderMojo builder; | 1025   std::unique_ptr<net::URLRequestContextBuilderMojo> builder = | 
| 1019   builder.set_name("main"); | 1026       base::MakeUnique<net::URLRequestContextBuilderMojo>(); | 
|  | 1027   builder->set_name("main"); | 
| 1020 | 1028 | 
| 1021   builder.set_net_log(io_thread->net_log()); | 1029   builder->set_net_log(io_thread->net_log()); | 
| 1022   builder.set_shared_http_user_agent_settings( | 1030   builder->set_shared_http_user_agent_settings( | 
| 1023       chrome_http_user_agent_settings_.get()); | 1031       chrome_http_user_agent_settings_.get()); | 
| 1024   builder.set_ssl_config_service(profile_params_->ssl_config_service); | 1032   builder->set_ssl_config_service(profile_params_->ssl_config_service); | 
| 1025 | 1033 | 
| 1026   builder.set_enable_brotli(io_thread_globals->enable_brotli); | 1034   builder->set_enable_brotli(io_thread_globals->enable_brotli); | 
| 1027 | 1035 | 
| 1028   std::unique_ptr<ChromeNetworkDelegate> chrome_network_delegate( | 1036   std::unique_ptr<ChromeNetworkDelegate> chrome_network_delegate( | 
| 1029       new ChromeNetworkDelegate( | 1037       new ChromeNetworkDelegate( | 
| 1030 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1038 #if BUILDFLAG(ENABLE_EXTENSIONS) | 
| 1031           io_thread_globals->extension_event_router_forwarder.get(), | 1039           io_thread_globals->extension_event_router_forwarder.get(), | 
| 1032 #else | 1040 #else | 
| 1033           NULL, | 1041           NULL, | 
| 1034 #endif | 1042 #endif | 
| 1035           &enable_referrers_)); | 1043           &enable_referrers_)); | 
| 1036 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1044 #if BUILDFLAG(ENABLE_EXTENSIONS) | 
| (...skipping 18 matching lines...) Expand all  Loading... | 
| 1055   chrome_network_delegate->set_force_youtube_restrict(&force_youtube_restrict_); | 1063   chrome_network_delegate->set_force_youtube_restrict(&force_youtube_restrict_); | 
| 1056   chrome_network_delegate->set_allowed_domains_for_apps( | 1064   chrome_network_delegate->set_allowed_domains_for_apps( | 
| 1057       &allowed_domains_for_apps_); | 1065       &allowed_domains_for_apps_); | 
| 1058   chrome_network_delegate->set_data_use_aggregator( | 1066   chrome_network_delegate->set_data_use_aggregator( | 
| 1059       io_thread_globals->data_use_aggregator.get(), IsOffTheRecord()); | 1067       io_thread_globals->data_use_aggregator.get(), IsOffTheRecord()); | 
| 1060 | 1068 | 
| 1061   std::unique_ptr<net::NetworkDelegate> network_delegate = | 1069   std::unique_ptr<net::NetworkDelegate> network_delegate = | 
| 1062       ConfigureNetworkDelegate(profile_params_->io_thread, | 1070       ConfigureNetworkDelegate(profile_params_->io_thread, | 
| 1063                                std::move(chrome_network_delegate)); | 1071                                std::move(chrome_network_delegate)); | 
| 1064 | 1072 | 
| 1065   builder.set_shared_host_resolver( | 1073   builder->set_shared_host_resolver( | 
| 1066       io_thread_globals->system_request_context->host_resolver()); | 1074       io_thread_globals->system_request_context->host_resolver()); | 
| 1067 | 1075 | 
| 1068   builder.set_shared_http_auth_handler_factory( | 1076   builder->set_shared_http_auth_handler_factory( | 
| 1069       io_thread_globals->system_request_context->http_auth_handler_factory()); | 1077       io_thread_globals->system_request_context->http_auth_handler_factory()); | 
| 1070 | 1078 | 
| 1071   io_thread->SetUpProxyConfigService( | 1079   io_thread->SetUpProxyConfigService( | 
| 1072       &builder, std::move(profile_params_->proxy_config_service)); | 1080       builder.get(), std::move(profile_params_->proxy_config_service)); | 
| 1073 | 1081 | 
| 1074   builder.set_network_delegate(std::move(network_delegate)); | 1082   builder->set_network_delegate(std::move(network_delegate)); | 
| 1075 | 1083 | 
| 1076   builder.set_transport_security_persister_path(profile_params_->path); | 1084   builder->set_transport_security_persister_path(profile_params_->path); | 
| 1077   builder.set_transport_security_persister_readonly(IsOffTheRecord()); | 1085   builder->set_transport_security_persister_readonly(IsOffTheRecord()); | 
| 1078 | 1086 | 
| 1079   // Take ownership over these parameters. | 1087   // Take ownership over these parameters. | 
| 1080   cookie_settings_ = profile_params_->cookie_settings; | 1088   cookie_settings_ = profile_params_->cookie_settings; | 
| 1081   host_content_settings_map_ = profile_params_->host_content_settings_map; | 1089   host_content_settings_map_ = profile_params_->host_content_settings_map; | 
| 1082 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1090 #if BUILDFLAG(ENABLE_EXTENSIONS) | 
| 1083   extension_info_map_ = profile_params_->extension_info_map; | 1091   extension_info_map_ = profile_params_->extension_info_map; | 
| 1084 #endif | 1092 #endif | 
| 1085 | 1093 | 
| 1086   if (profile_params_->loading_predictor_observer_) { | 1094   if (profile_params_->loading_predictor_observer_) { | 
| 1087     loading_predictor_observer_ = | 1095     loading_predictor_observer_ = | 
| 1088         std::move(profile_params_->loading_predictor_observer_); | 1096         std::move(profile_params_->loading_predictor_observer_); | 
| 1089   } | 1097   } | 
| 1090 | 1098 | 
| 1091 #if defined(OS_CHROMEOS) | 1099 #if defined(OS_CHROMEOS) | 
| 1092   username_hash_ = profile_params_->username_hash; | 1100   username_hash_ = profile_params_->username_hash; | 
| 1093   use_system_key_slot_ = profile_params_->use_system_key_slot; | 1101   use_system_key_slot_ = profile_params_->use_system_key_slot; | 
| 1094   if (use_system_key_slot_) | 1102   if (use_system_key_slot_) | 
| 1095     EnableNSSSystemKeySlotForResourceContext(resource_context_.get()); | 1103     EnableNSSSystemKeySlotForResourceContext(resource_context_.get()); | 
| 1096 | 1104 | 
| 1097   certificate_provider_ = std::move(profile_params_->certificate_provider); | 1105   certificate_provider_ = std::move(profile_params_->certificate_provider); | 
| 1098 #endif | 1106 #endif | 
| 1099 | 1107 | 
| 1100   if (g_cert_verifier_for_testing) { | 1108   if (g_cert_verifier_for_testing) { | 
| 1101     builder.set_shared_cert_verifier(g_cert_verifier_for_testing); | 1109     builder->set_shared_cert_verifier(g_cert_verifier_for_testing); | 
| 1102   } else { | 1110   } else { | 
| 1103 #if defined(OS_CHROMEOS) | 1111 #if defined(OS_CHROMEOS) | 
| 1104     crypto::ScopedPK11Slot public_slot = | 1112     crypto::ScopedPK11Slot public_slot = | 
| 1105         crypto::GetPublicSlotForChromeOSUser(username_hash_); | 1113         crypto::GetPublicSlotForChromeOSUser(username_hash_); | 
| 1106     // The private slot won't be ready by this point. It shouldn't be necessary | 1114     // The private slot won't be ready by this point. It shouldn't be necessary | 
| 1107     // for cert trust purposes anyway. | 1115     // for cert trust purposes anyway. | 
| 1108     scoped_refptr<net::CertVerifyProc> verify_proc( | 1116     scoped_refptr<net::CertVerifyProc> verify_proc( | 
| 1109         new chromeos::CertVerifyProcChromeOS(std::move(public_slot))); | 1117         new chromeos::CertVerifyProcChromeOS(std::move(public_slot))); | 
| 1110     if (policy_cert_verifier_) { | 1118     if (policy_cert_verifier_) { | 
| 1111       DCHECK_EQ(policy_cert_verifier_, cert_verifier_.get()); | 1119       DCHECK_EQ(policy_cert_verifier_, cert_verifier_.get()); | 
| 1112       policy_cert_verifier_->InitializeOnIOThread(verify_proc); | 1120       policy_cert_verifier_->InitializeOnIOThread(verify_proc); | 
| 1113     } else { | 1121     } else { | 
| 1114       cert_verifier_ = base::MakeUnique<net::CachingCertVerifier>( | 1122       cert_verifier_ = base::MakeUnique<net::CachingCertVerifier>( | 
| 1115           base::MakeUnique<net::MultiThreadedCertVerifier>(verify_proc.get())); | 1123           base::MakeUnique<net::MultiThreadedCertVerifier>(verify_proc.get())); | 
| 1116     } | 1124     } | 
| 1117     builder.set_shared_cert_verifier(cert_verifier_.get()); | 1125     builder->set_shared_cert_verifier(cert_verifier_.get()); | 
| 1118 #else | 1126 #else | 
| 1119     builder.set_shared_cert_verifier( | 1127     builder->set_shared_cert_verifier( | 
| 1120         io_thread_globals->system_request_context->cert_verifier()); | 1128         io_thread_globals->system_request_context->cert_verifier()); | 
| 1121 #endif | 1129 #endif | 
| 1122   } | 1130   } | 
| 1123 | 1131 | 
| 1124   // Install the New Tab Page Interceptor. | 1132   // Install the New Tab Page Interceptor. | 
| 1125   if (profile_params_->new_tab_page_interceptor.get()) { | 1133   if (profile_params_->new_tab_page_interceptor.get()) { | 
| 1126     request_interceptors.push_back( | 1134     request_interceptors.push_back( | 
| 1127         std::move(profile_params_->new_tab_page_interceptor)); | 1135         std::move(profile_params_->new_tab_page_interceptor)); | 
| 1128   } | 1136   } | 
| 1129 | 1137 | 
| 1130   std::unique_ptr<net::MultiLogCTVerifier> ct_verifier( | 1138   std::unique_ptr<net::MultiLogCTVerifier> ct_verifier( | 
| 1131       new net::MultiLogCTVerifier()); | 1139       new net::MultiLogCTVerifier()); | 
| 1132   ct_verifier->AddLogs(io_thread_globals->ct_logs); | 1140   ct_verifier->AddLogs(io_thread_globals->ct_logs); | 
| 1133 | 1141 | 
| 1134   ct_tree_tracker_.reset(new certificate_transparency::TreeStateTracker( | 1142   ct_tree_tracker_.reset(new certificate_transparency::TreeStateTracker( | 
| 1135       io_thread_globals->ct_logs, io_thread->net_log())); | 1143       io_thread_globals->ct_logs, io_thread->net_log())); | 
| 1136   ct_verifier->SetObserver(ct_tree_tracker_.get()); | 1144   ct_verifier->SetObserver(ct_tree_tracker_.get()); | 
| 1137 | 1145 | 
| 1138   builder.set_ct_verifier(std::move(ct_verifier)); | 1146   builder->set_ct_verifier(std::move(ct_verifier)); | 
| 1139 | 1147 | 
| 1140   io_thread->RegisterSTHObserver(ct_tree_tracker_.get()); | 1148   io_thread->RegisterSTHObserver(ct_tree_tracker_.get()); | 
| 1141   ct_tree_tracker_unregistration_ = | 1149   ct_tree_tracker_unregistration_ = | 
| 1142       base::Bind(&IOThread::UnregisterSTHObserver, base::Unretained(io_thread), | 1150       base::Bind(&IOThread::UnregisterSTHObserver, base::Unretained(io_thread), | 
| 1143                  ct_tree_tracker_.get()); | 1151                  ct_tree_tracker_.get()); | 
| 1144 | 1152 | 
| 1145   builder.set_http_network_session_params( | 1153   builder->set_http_network_session_params( | 
| 1146       profile_params_->io_thread->NetworkSessionParams()); | 1154       profile_params_->io_thread->NetworkSessionParams()); | 
| 1147   if (data_reduction_proxy_io_data_.get()) { | 1155   if (data_reduction_proxy_io_data_.get()) { | 
| 1148     builder.set_shared_proxy_delegate( | 1156     builder->set_shared_proxy_delegate( | 
| 1149         data_reduction_proxy_io_data_->proxy_delegate()); | 1157         data_reduction_proxy_io_data_->proxy_delegate()); | 
| 1150   } | 1158   } | 
| 1151 | 1159 | 
| 1152   InitializeInternal(&builder, profile_params_.get(), protocol_handlers, | 1160   InitializeInternal(builder.get(), profile_params_.get(), protocol_handlers, | 
| 1153                      std::move(request_interceptors)); | 1161                      std::move(request_interceptors)); | 
| 1154 | 1162 | 
| 1155   main_request_context_ = builder.Build(); | 1163   main_network_context_ = | 
|  | 1164       io_thread_globals->network_service->CreateNetworkContextWithBuilder( | 
|  | 1165           std::move(profile_params_->main_network_context_request), | 
|  | 1166           std::move(profile_params_->main_network_context_params), | 
|  | 1167           std::move(builder), &main_request_context_); | 
| 1156 | 1168 | 
| 1157   // Attach some things to the URLRequestContextBuilder's | 1169   // Attach some things to the URLRequestContextBuilder's | 
| 1158   // TransportSecurityState.  Since no requests have been made yet, safe to do | 1170   // TransportSecurityState.  Since no requests have been made yet, safe to do | 
| 1159   // this even after the call to Build(). | 1171   // this even after the call to Build(). | 
| 1160 | 1172 | 
| 1161   net::NetworkTrafficAnnotationTag traffic_annotation = | 1173   net::NetworkTrafficAnnotationTag traffic_annotation = | 
| 1162       net::DefineNetworkTrafficAnnotation("domain_security_policy", R"( | 1174       net::DefineNetworkTrafficAnnotation("domain_security_policy", R"( | 
| 1163         semantics { | 1175         semantics { | 
| 1164           sender: "Domain Security Policy" | 1176           sender: "Domain Security Policy" | 
| 1165           description: | 1177           description: | 
| (...skipping 14 matching lines...) Expand all  Loading... | 
| 1180           destination: OTHER | 1192           destination: OTHER | 
| 1181         } | 1193         } | 
| 1182         policy { | 1194         policy { | 
| 1183           cookies_allowed: false | 1195           cookies_allowed: false | 
| 1184           setting: "This feature cannot be disabled by settings." | 1196           setting: "This feature cannot be disabled by settings." | 
| 1185           policy_exception_justification: | 1197           policy_exception_justification: | 
| 1186             "Not implemented, this is a feature that websites can opt into and " | 1198             "Not implemented, this is a feature that websites can opt into and " | 
| 1187             "thus there is no Chrome-wide policy to disable it." | 1199             "thus there is no Chrome-wide policy to disable it." | 
| 1188         })"); | 1200         })"); | 
| 1189   certificate_report_sender_.reset( | 1201   certificate_report_sender_.reset( | 
| 1190       new net::ReportSender(main_request_context_.get(), traffic_annotation)); | 1202       new net::ReportSender(main_request_context_, traffic_annotation)); | 
| 1191   main_request_context_->transport_security_state()->SetReportSender( | 1203   main_request_context_->transport_security_state()->SetReportSender( | 
| 1192       certificate_report_sender_.get()); | 1204       certificate_report_sender_.get()); | 
| 1193 | 1205 | 
| 1194   expect_ct_reporter_.reset( | 1206   expect_ct_reporter_.reset(new ChromeExpectCTReporter(main_request_context_)); | 
| 1195       new ChromeExpectCTReporter(main_request_context_.get())); |  | 
| 1196   main_request_context_->transport_security_state()->SetExpectCTReporter( | 1207   main_request_context_->transport_security_state()->SetExpectCTReporter( | 
| 1197       expect_ct_reporter_.get()); | 1208       expect_ct_reporter_.get()); | 
| 1198 | 1209 | 
| 1199   main_request_context_->transport_security_state()->SetRequireCTDelegate( | 1210   main_request_context_->transport_security_state()->SetRequireCTDelegate( | 
| 1200       ct_policy_manager_->GetDelegate()); | 1211       ct_policy_manager_->GetDelegate()); | 
| 1201 | 1212 | 
| 1202   resource_context_->host_resolver_ = | 1213   resource_context_->host_resolver_ = | 
| 1203       io_thread_globals->system_request_context->host_resolver(); | 1214       io_thread_globals->system_request_context->host_resolver(); | 
| 1204   resource_context_->request_context_ = main_request_context_.get(); | 1215   resource_context_->request_context_ = main_request_context_; | 
| 1205 | 1216 | 
| 1206   OnMainRequestContextCreated(profile_params_.get()); | 1217   OnMainRequestContextCreated(profile_params_.get()); | 
| 1207 | 1218 | 
| 1208   profile_params_.reset(); | 1219   profile_params_.reset(); | 
| 1209   initialized_ = true; | 1220   initialized_ = true; | 
| 1210 } | 1221 } | 
| 1211 | 1222 | 
| 1212 std::unique_ptr<net::URLRequestJobFactory> | 1223 std::unique_ptr<net::URLRequestJobFactory> | 
| 1213 ProfileIOData::SetUpJobFactoryDefaults( | 1224 ProfileIOData::SetUpJobFactoryDefaults( | 
| 1214     std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory, | 1225     std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory, | 
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1423 void ProfileIOData::SetCookieSettingsForTesting( | 1434 void ProfileIOData::SetCookieSettingsForTesting( | 
| 1424     content_settings::CookieSettings* cookie_settings) { | 1435     content_settings::CookieSettings* cookie_settings) { | 
| 1425   DCHECK(!cookie_settings_.get()); | 1436   DCHECK(!cookie_settings_.get()); | 
| 1426   cookie_settings_ = cookie_settings; | 1437   cookie_settings_ = cookie_settings; | 
| 1427 } | 1438 } | 
| 1428 | 1439 | 
| 1429 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( | 1440 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( | 
| 1430     const GURL& url) const { | 1441     const GURL& url) const { | 
| 1431   return url_blacklist_manager_->GetURLBlacklistState(url); | 1442   return url_blacklist_manager_->GetURLBlacklistState(url); | 
| 1432 } | 1443 } | 
| OLD | NEW | 
|---|