| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/ios_chrome_io_thread.h" | 5 #include "ios/chrome/browser/ios_chrome_io_thread.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "net/cert/multi_log_ct_verifier.h" | 52 #include "net/cert/multi_log_ct_verifier.h" |
| 53 #include "net/cert/multi_threaded_cert_verifier.h" | 53 #include "net/cert/multi_threaded_cert_verifier.h" |
| 54 #include "net/cert_net/nss_ocsp.h" | 54 #include "net/cert_net/nss_ocsp.h" |
| 55 #include "net/cookies/cookie_monster.h" | 55 #include "net/cookies/cookie_monster.h" |
| 56 #include "net/cookies/cookie_store.h" | 56 #include "net/cookies/cookie_store.h" |
| 57 #include "net/dns/host_cache.h" | 57 #include "net/dns/host_cache.h" |
| 58 #include "net/dns/host_resolver.h" | 58 #include "net/dns/host_resolver.h" |
| 59 #include "net/dns/mapped_host_resolver.h" | 59 #include "net/dns/mapped_host_resolver.h" |
| 60 #include "net/http/http_auth_filter.h" | 60 #include "net/http/http_auth_filter.h" |
| 61 #include "net/http/http_auth_handler_factory.h" | 61 #include "net/http/http_auth_handler_factory.h" |
| 62 #include "net/http/http_auth_preferences.h" |
| 62 #include "net/http/http_network_layer.h" | 63 #include "net/http/http_network_layer.h" |
| 63 #include "net/http/http_network_session.h" | 64 #include "net/http/http_network_session.h" |
| 64 #include "net/http/http_server_properties_impl.h" | 65 #include "net/http/http_server_properties_impl.h" |
| 65 #include "net/proxy/proxy_config_service.h" | 66 #include "net/proxy/proxy_config_service.h" |
| 66 #include "net/proxy/proxy_script_fetcher_impl.h" | 67 #include "net/proxy/proxy_script_fetcher_impl.h" |
| 67 #include "net/proxy/proxy_service.h" | 68 #include "net/proxy/proxy_service.h" |
| 68 #include "net/quic/crypto/crypto_protocol.h" | 69 #include "net/quic/crypto/crypto_protocol.h" |
| 69 #include "net/quic/quic_protocol.h" | 70 #include "net/quic/quic_protocol.h" |
| 70 #include "net/quic/quic_utils.h" | 71 #include "net/quic/quic_utils.h" |
| 71 #include "net/socket/tcp_client_socket.h" | 72 #include "net/socket/tcp_client_socket.h" |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 net::MultiLogCTVerifier* ct_verifier = new net::MultiLogCTVerifier(); | 402 net::MultiLogCTVerifier* ct_verifier = new net::MultiLogCTVerifier(); |
| 402 globals_->cert_transparency_verifier.reset(ct_verifier); | 403 globals_->cert_transparency_verifier.reset(ct_verifier); |
| 403 // Add built-in logs | 404 // Add built-in logs |
| 404 ct_verifier->AddLogs(ct_logs); | 405 ct_verifier->AddLogs(ct_logs); |
| 405 | 406 |
| 406 net::CertPolicyEnforcer* policy_enforcer = new net::CertPolicyEnforcer; | 407 net::CertPolicyEnforcer* policy_enforcer = new net::CertPolicyEnforcer; |
| 407 globals_->cert_policy_enforcer.reset(policy_enforcer); | 408 globals_->cert_policy_enforcer.reset(policy_enforcer); |
| 408 | 409 |
| 409 globals_->ssl_config_service = GetSSLConfigService(); | 410 globals_->ssl_config_service = GetSSLConfigService(); |
| 410 | 411 |
| 411 globals_->http_auth_handler_factory.reset( | 412 CreateDefaultAuthHandlerFactory(); |
| 412 CreateDefaultAuthHandlerFactory(globals_->host_resolver.get())); | |
| 413 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl()); | 413 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl()); |
| 414 // In-memory cookie store. | 414 // In-memory cookie store. |
| 415 globals_->system_cookie_store = new net::CookieMonster(nullptr, nullptr); | 415 globals_->system_cookie_store = new net::CookieMonster(nullptr, nullptr); |
| 416 // In-memory channel ID store. | 416 // In-memory channel ID store. |
| 417 globals_->system_channel_id_service.reset( | 417 globals_->system_channel_id_service.reset( |
| 418 new net::ChannelIDService(new net::DefaultChannelIDStore(nullptr), | 418 new net::ChannelIDService(new net::DefaultChannelIDStore(nullptr), |
| 419 base::WorkerPool::GetTaskRunner(true))); | 419 base::WorkerPool::GetTaskRunner(true))); |
| 420 globals_->http_user_agent_settings.reset(new net::StaticHttpUserAgentSettings( | 420 globals_->http_user_agent_settings.reset(new net::StaticHttpUserAgentSettings( |
| 421 std::string(), web::GetWebClient()->GetUserAgent(false))); | 421 std::string(), web::GetWebClient()->GetUserAgent(false))); |
| 422 if (command_line.HasSwitch(switches::kIOSTestingFixedHttpPort)) { | 422 if (command_line.HasSwitch(switches::kIOSTestingFixedHttpPort)) { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 void IOSChromeIOThread::ConfigureNPNGlobals( | 556 void IOSChromeIOThread::ConfigureNPNGlobals( |
| 557 base::StringPiece npn_trial_group, | 557 base::StringPiece npn_trial_group, |
| 558 IOSChromeIOThread::Globals* globals) { | 558 IOSChromeIOThread::Globals* globals) { |
| 559 if (npn_trial_group.starts_with(kNpnTrialEnabledGroupNamePrefix)) { | 559 if (npn_trial_group.starts_with(kNpnTrialEnabledGroupNamePrefix)) { |
| 560 globals->enable_npn.set(true); | 560 globals->enable_npn.set(true); |
| 561 } else if (npn_trial_group.starts_with(kNpnTrialDisabledGroupNamePrefix)) { | 561 } else if (npn_trial_group.starts_with(kNpnTrialDisabledGroupNamePrefix)) { |
| 562 globals->enable_npn.set(false); | 562 globals->enable_npn.set(false); |
| 563 } | 563 } |
| 564 } | 564 } |
| 565 | 565 |
| 566 net::HttpAuthHandlerFactory* IOSChromeIOThread::CreateDefaultAuthHandlerFactory( | 566 void IOSChromeIOThread::CreateDefaultAuthHandlerFactory() { |
| 567 net::HostResolver* resolver) { | 567 std::vector<std::string> supported_schemes = |
| 568 globals_->url_security_manager.reset(net::URLSecurityManager::Create( | 568 base::SplitString(kSupportedAuthSchemes, ",", base::TRIM_WHITESPACE, |
| 569 nullptr /* whitelist_default */, nullptr /* whitelist_delegate */)); | 569 base::SPLIT_WANT_NONEMPTY); |
| 570 std::vector<std::string> supported_schemes = base::SplitString( | 570 globals_->http_auth_preferences.reset( |
| 571 kSupportedAuthSchemes, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 571 new net::HttpAuthPreferences(supported_schemes, std::string())); |
| 572 | 572 globals_->http_auth_handler_factory = |
| 573 scoped_ptr<net::HttpAuthHandlerRegistryFactory> registry_factory( | |
| 574 net::HttpAuthHandlerRegistryFactory::Create( | 573 net::HttpAuthHandlerRegistryFactory::Create( |
| 575 supported_schemes, globals_->url_security_manager.get(), resolver, | 574 globals_->http_auth_preferences.get(), globals_->host_resolver.get()) |
| 576 std::string() /* gssapi_library_name */, | 575 .Pass(); |
| 577 std::string() /* auth_android_negotiate_account_type */, | |
| 578 false /* negotiate_disable_cname_lookup */, | |
| 579 false /* negotiate_enable_port */)); | |
| 580 return registry_factory.release(); | |
| 581 } | 576 } |
| 582 | 577 |
| 583 void IOSChromeIOThread::ClearHostCache() { | 578 void IOSChromeIOThread::ClearHostCache() { |
| 584 DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); | 579 DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); |
| 585 | 580 |
| 586 net::HostCache* host_cache = globals_->host_resolver->GetHostCache(); | 581 net::HostCache* host_cache = globals_->host_resolver->GetHostCache(); |
| 587 if (host_cache) | 582 if (host_cache) |
| 588 host_cache->clear(); | 583 host_cache->clear(); |
| 589 } | 584 } |
| 590 | 585 |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 | 1007 |
| 1013 globals->system_http_network_session.reset( | 1008 globals->system_http_network_session.reset( |
| 1014 new net::HttpNetworkSession(system_params)); | 1009 new net::HttpNetworkSession(system_params)); |
| 1015 globals->system_http_transaction_factory.reset( | 1010 globals->system_http_transaction_factory.reset( |
| 1016 new net::HttpNetworkLayer(globals->system_http_network_session.get())); | 1011 new net::HttpNetworkLayer(globals->system_http_network_session.get())); |
| 1017 context->set_http_transaction_factory( | 1012 context->set_http_transaction_factory( |
| 1018 globals->system_http_transaction_factory.get()); | 1013 globals->system_http_transaction_factory.get()); |
| 1019 | 1014 |
| 1020 return context; | 1015 return context; |
| 1021 } | 1016 } |
| OLD | NEW |