| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/cronet/ios/cronet_environment.h" | 5 #include "components/cronet/ios/cronet_environment.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/atomicops.h" | 10 #include "base/atomicops.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "net/dns/mapped_host_resolver.h" | 35 #include "net/dns/mapped_host_resolver.h" |
| 36 #include "net/http/http_server_properties_impl.h" | 36 #include "net/http/http_server_properties_impl.h" |
| 37 #include "net/http/http_stream_factory.h" | 37 #include "net/http/http_stream_factory.h" |
| 38 #include "net/http/http_transaction_factory.h" | 38 #include "net/http/http_transaction_factory.h" |
| 39 #include "net/http/http_util.h" | 39 #include "net/http/http_util.h" |
| 40 #include "net/log/net_log.h" | 40 #include "net/log/net_log.h" |
| 41 #include "net/log/net_log_capture_mode.h" | 41 #include "net/log/net_log_capture_mode.h" |
| 42 #include "net/log/write_to_file_net_log_observer.h" | 42 #include "net/log/write_to_file_net_log_observer.h" |
| 43 #include "net/proxy/proxy_service.h" | 43 #include "net/proxy/proxy_service.h" |
| 44 #include "net/socket/ssl_client_socket.h" | 44 #include "net/socket/ssl_client_socket.h" |
| 45 #include "net/ssl/channel_id_service.h" |
| 45 #include "net/url_request/http_user_agent_settings.h" | 46 #include "net/url_request/http_user_agent_settings.h" |
| 46 #include "net/url_request/url_request_context.h" | 47 #include "net/url_request/url_request_context.h" |
| 47 #include "net/url_request/url_request_context_builder.h" | 48 #include "net/url_request/url_request_context_builder.h" |
| 48 #include "net/url_request/url_request_context_storage.h" | 49 #include "net/url_request/url_request_context_storage.h" |
| 49 #include "net/url_request/url_request_job_factory_impl.h" | 50 #include "net/url_request/url_request_job_factory_impl.h" |
| 50 #include "url/scheme_host_port.h" | 51 #include "url/scheme_host_port.h" |
| 51 #include "url/url_util.h" | 52 #include "url/url_util.h" |
| 52 | 53 |
| 53 namespace { | 54 namespace { |
| 54 | 55 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 299 |
| 299 config->ConfigureURLRequestContextBuilder(&context_builder, net_log_.get(), | 300 config->ConfigureURLRequestContextBuilder(&context_builder, net_log_.get(), |
| 300 file_thread_.get()->task_runner()); | 301 file_thread_.get()->task_runner()); |
| 301 | 302 |
| 302 std::unique_ptr<net::MappedHostResolver> mapped_host_resolver( | 303 std::unique_ptr<net::MappedHostResolver> mapped_host_resolver( |
| 303 new net::MappedHostResolver( | 304 new net::MappedHostResolver( |
| 304 net::HostResolver::CreateDefaultResolver(nullptr))); | 305 net::HostResolver::CreateDefaultResolver(nullptr))); |
| 305 | 306 |
| 306 context_builder.set_host_resolver(std::move(mapped_host_resolver)); | 307 context_builder.set_host_resolver(std::move(mapped_host_resolver)); |
| 307 | 308 |
| 309 std::unique_ptr<net::CookieStore> cookie_store( |
| 310 net::CookieStoreIOS::CreateCookieStore( |
| 311 [NSHTTPCookieStorage sharedHTTPCookieStorage])); |
| 312 context_builder.SetCookieAndChannelIdStores(std::move(cookie_store), nullptr); |
| 313 |
| 308 std::unordered_set<std::string> quic_host_whitelist; | 314 std::unordered_set<std::string> quic_host_whitelist; |
| 309 std::unique_ptr<net::HttpServerProperties> http_server_properties( | 315 std::unique_ptr<net::HttpServerProperties> http_server_properties( |
| 310 new net::HttpServerPropertiesImpl()); | 316 new net::HttpServerPropertiesImpl()); |
| 311 for (const auto& quic_hint : quic_hints_) { | 317 for (const auto& quic_hint : quic_hints_) { |
| 312 net::AlternativeService alternative_service(net::kProtoQUIC, "", | 318 net::AlternativeService alternative_service(net::kProtoQUIC, "", |
| 313 quic_hint.port()); | 319 quic_hint.port()); |
| 314 url::SchemeHostPort quic_hint_server("https", quic_hint.host(), | 320 url::SchemeHostPort quic_hint_server("https", quic_hint.host(), |
| 315 quic_hint.port()); | 321 quic_hint.port()); |
| 316 http_server_properties->SetAlternativeService( | 322 http_server_properties->SetAlternativeService( |
| 317 quic_hint_server, alternative_service, base::Time::Max()); | 323 quic_hint_server, alternative_service, base::Time::Max()); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 event->Signal(); | 366 event->Signal(); |
| 361 } | 367 } |
| 362 | 368 |
| 363 std::string CronetEnvironment::getDefaultQuicUserAgentId() const { | 369 std::string CronetEnvironment::getDefaultQuicUserAgentId() const { |
| 364 return base::SysNSStringToUTF8([[NSBundle mainBundle] | 370 return base::SysNSStringToUTF8([[NSBundle mainBundle] |
| 365 objectForInfoDictionaryKey:@"CFBundleDisplayName"]) + | 371 objectForInfoDictionaryKey:@"CFBundleDisplayName"]) + |
| 366 " Cronet/" + CRONET_VERSION; | 372 " Cronet/" + CRONET_VERSION; |
| 367 } | 373 } |
| 368 | 374 |
| 369 } // namespace cronet | 375 } // namespace cronet |
| OLD | NEW |