| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 main_context_->set_net_log(net_log_.get()); | 267 main_context_->set_net_log(net_log_.get()); |
| 268 std::string user_agent(user_agent_product_name_ + | 268 std::string user_agent(user_agent_product_name_ + |
| 269 " (iOS); Cronet/" CRONET_VERSION); | 269 " (iOS); Cronet/" CRONET_VERSION); |
| 270 main_context_->set_http_user_agent_settings( | 270 main_context_->set_http_user_agent_settings( |
| 271 new net::StaticHttpUserAgentSettings("en", user_agent)); | 271 new net::StaticHttpUserAgentSettings("en", user_agent)); |
| 272 | 272 |
| 273 main_context_->set_ssl_config_service(new net::SSLConfigServiceDefaults); | 273 main_context_->set_ssl_config_service(new net::SSLConfigServiceDefaults); |
| 274 main_context_->set_transport_security_state( | 274 main_context_->set_transport_security_state( |
| 275 new net::TransportSecurityState()); | 275 new net::TransportSecurityState()); |
| 276 http_server_properties_.reset(new net::HttpServerPropertiesImpl()); | 276 http_server_properties_.reset(new net::HttpServerPropertiesImpl()); |
| 277 main_context_->set_http_server_properties( | 277 main_context_->set_http_server_properties(http_server_properties_.get()); |
| 278 http_server_properties_->GetWeakPtr()); | |
| 279 | 278 |
| 280 // TODO(rdsmith): Note that the ".release()" calls below are leaking | 279 // TODO(rdsmith): Note that the ".release()" calls below are leaking |
| 281 // the objects in question; this should be fixed by having an object | 280 // the objects in question; this should be fixed by having an object |
| 282 // corresponding to URLRequestContextStorage that actually owns those | 281 // corresponding to URLRequestContextStorage that actually owns those |
| 283 // objects. See http://crbug.com/523858. | 282 // objects. See http://crbug.com/523858. |
| 284 std::unique_ptr<net::MappedHostResolver> mapped_host_resolver( | 283 std::unique_ptr<net::MappedHostResolver> mapped_host_resolver( |
| 285 new net::MappedHostResolver( | 284 new net::MappedHostResolver( |
| 286 net::HostResolver::CreateDefaultResolver(nullptr))); | 285 net::HostResolver::CreateDefaultResolver(nullptr))); |
| 287 | 286 |
| 288 mapped_host_resolver->SetRulesFromString(host_resolver_rules_); | 287 mapped_host_resolver->SetRulesFromString(host_resolver_rules_); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 const net::HttpUserAgentSettings* user_agent_settings = | 364 const net::HttpUserAgentSettings* user_agent_settings = |
| 366 main_context_->http_user_agent_settings(); | 365 main_context_->http_user_agent_settings(); |
| 367 if (!user_agent_settings) { | 366 if (!user_agent_settings) { |
| 368 return nullptr; | 367 return nullptr; |
| 369 } | 368 } |
| 370 | 369 |
| 371 return user_agent_settings->GetUserAgent(); | 370 return user_agent_settings->GetUserAgent(); |
| 372 } | 371 } |
| 373 | 372 |
| 374 } // namespace cronet | 373 } // namespace cronet |
| OLD | NEW |