| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/android/url_request_context_adapter.h" | 5 #include "components/cronet/android/url_request_context_adapter.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 net::URLRequestContextBuilder context_builder; | 147 net::URLRequestContextBuilder context_builder; |
| 148 context_builder.set_network_delegate(new BasicNetworkDelegate()); | 148 context_builder.set_network_delegate(new BasicNetworkDelegate()); |
| 149 context_builder.set_proxy_config_service(proxy_config_service_.get()); | 149 context_builder.set_proxy_config_service(proxy_config_service_.get()); |
| 150 config_->ConfigureURLRequestContextBuilder(&context_builder); | 150 config_->ConfigureURLRequestContextBuilder(&context_builder); |
| 151 | 151 |
| 152 context_.reset(context_builder.Build()); | 152 context_.reset(context_builder.Build()); |
| 153 | 153 |
| 154 // Currently (circa M39) enabling QUIC requires setting probability threshold. | 154 // Currently (circa M39) enabling QUIC requires setting probability threshold. |
| 155 if (config_->enable_quic) { | 155 if (config_->enable_quic) { |
| 156 context_->http_server_properties() | 156 context_->http_server_properties() |
| 157 ->SetAlternateProtocolProbabilityThreshold(0.0f); | 157 ->SetAlternativeServiceProbabilityThreshold(0.0f); |
| 158 for (size_t hint = 0; hint < config_->quic_hints.size(); ++hint) { | 158 for (size_t hint = 0; hint < config_->quic_hints.size(); ++hint) { |
| 159 const URLRequestContextConfig::QuicHint& quic_hint = | 159 const URLRequestContextConfig::QuicHint& quic_hint = |
| 160 *config_->quic_hints[hint]; | 160 *config_->quic_hints[hint]; |
| 161 if (quic_hint.host.empty()) { | 161 if (quic_hint.host.empty()) { |
| 162 LOG(ERROR) << "Empty QUIC hint host: " << quic_hint.host; | 162 LOG(ERROR) << "Empty QUIC hint host: " << quic_hint.host; |
| 163 continue; | 163 continue; |
| 164 } | 164 } |
| 165 | 165 |
| 166 url::CanonHostInfo host_info; | 166 url::CanonHostInfo host_info; |
| 167 std::string canon_host(net::CanonicalizeHost(quic_hint.host, &host_info)); | 167 std::string canon_host(net::CanonicalizeHost(quic_hint.host, &host_info)); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 net_log_logger_.reset(); | 297 net_log_logger_.reset(); |
| 298 } | 298 } |
| 299 } | 299 } |
| 300 | 300 |
| 301 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { | 301 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { |
| 302 VLOG(2) << "Net log entry: type=" << entry.type() | 302 VLOG(2) << "Net log entry: type=" << entry.type() |
| 303 << ", source=" << entry.source().type << ", phase=" << entry.phase(); | 303 << ", source=" << entry.source().type << ", phase=" << entry.phase(); |
| 304 } | 304 } |
| 305 | 305 |
| 306 } // namespace cronet | 306 } // namespace cronet |
| OLD | NEW |