Chromium Code Reviews| 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 params.http_auth_handler_factory = main_context_->http_auth_handler_factory(); | 320 params.http_auth_handler_factory = main_context_->http_auth_handler_factory(); |
| 321 params.http_server_properties = main_context_->http_server_properties(); | 321 params.http_server_properties = main_context_->http_server_properties(); |
| 322 params.net_log = main_context_->net_log(); | 322 params.net_log = main_context_->net_log(); |
| 323 params.enable_http2 = http2_enabled(); | 323 params.enable_http2 = http2_enabled(); |
| 324 params.parse_alternative_services = false; | 324 params.parse_alternative_services = false; |
| 325 params.enable_quic = quic_enabled(); | 325 params.enable_quic = quic_enabled(); |
| 326 | 326 |
| 327 for (const auto& quic_hint : quic_hints_) { | 327 for (const auto& quic_hint : quic_hints_) { |
| 328 net::AlternativeService alternative_service(net::AlternateProtocol::QUIC, | 328 net::AlternativeService alternative_service(net::AlternateProtocol::QUIC, |
| 329 "", quic_hint.port()); | 329 "", quic_hint.port()); |
| 330 | 330 url::SchemeHostPort quic_hint_server("https", quic_hint.host(), |
|
mmenke
2016/04/21 18:52:34
include url/scheme_host_port.h
Zhongyi Shi
2016/04/21 19:44:29
Done.
| |
| 331 quic_hint.port()); | |
| 331 main_context_->http_server_properties()->SetAlternativeService( | 332 main_context_->http_server_properties()->SetAlternativeService( |
| 332 quic_hint, alternative_service, base::Time::Max()); | 333 quic_hint_server, alternative_service, base::Time::Max()); |
| 333 params.quic_host_whitelist.insert(quic_hint.host()); | 334 params.quic_host_whitelist.insert(quic_hint.host()); |
| 334 } | 335 } |
| 335 | 336 |
| 336 if (!params.channel_id_service) { | 337 if (!params.channel_id_service) { |
| 337 // The main context may not have a ChannelIDService, since it is lazily | 338 // The main context may not have a ChannelIDService, since it is lazily |
| 338 // constructed. If not, build an ephemeral ChannelIDService with no backing | 339 // constructed. If not, build an ephemeral ChannelIDService with no backing |
| 339 // disk store. | 340 // disk store. |
| 340 // TODO(ellyjones): support persisting ChannelID. | 341 // TODO(ellyjones): support persisting ChannelID. |
| 341 params.channel_id_service = | 342 params.channel_id_service = |
| 342 new net::ChannelIDService(new net::DefaultChannelIDStore(NULL), | 343 new net::ChannelIDService(new net::DefaultChannelIDStore(NULL), |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 362 const net::HttpUserAgentSettings* user_agent_settings = | 363 const net::HttpUserAgentSettings* user_agent_settings = |
| 363 main_context_->http_user_agent_settings(); | 364 main_context_->http_user_agent_settings(); |
| 364 if (!user_agent_settings) { | 365 if (!user_agent_settings) { |
| 365 return nullptr; | 366 return nullptr; |
| 366 } | 367 } |
| 367 | 368 |
| 368 return user_agent_settings->GetUserAgent(); | 369 return user_agent_settings->GetUserAgent(); |
| 369 } | 370 } |
| 370 | 371 |
| 371 } // namespace cronet | 372 } // namespace cronet |
| OLD | NEW |