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