| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 if (quic_hint.alternate_port <= std::numeric_limits<uint16>::min() || | 197 if (quic_hint.alternate_port <= std::numeric_limits<uint16>::min() || |
| 198 quic_hint.alternate_port > std::numeric_limits<uint16>::max()) { | 198 quic_hint.alternate_port > std::numeric_limits<uint16>::max()) { |
| 199 LOG(ERROR) << "Invalid QUIC hint alternate port: " | 199 LOG(ERROR) << "Invalid QUIC hint alternate port: " |
| 200 << quic_hint.alternate_port; | 200 << quic_hint.alternate_port; |
| 201 continue; | 201 continue; |
| 202 } | 202 } |
| 203 | 203 |
| 204 net::HostPortPair quic_hint_host_port_pair(canon_host, | 204 net::HostPortPair quic_hint_host_port_pair(canon_host, |
| 205 quic_hint.port); | 205 quic_hint.port); |
| 206 context_->http_server_properties()->SetAlternateProtocol( | 206 context_->http_server_properties()->AddAlternateProtocol( |
| 207 quic_hint_host_port_pair, | 207 quic_hint_host_port_pair, |
| 208 static_cast<uint16>(quic_hint.alternate_port), | 208 static_cast<uint16>(quic_hint.alternate_port), |
| 209 net::AlternateProtocol::QUIC, | 209 net::AlternateProtocol::QUIC, 1.0f); |
| 210 1.0f); | |
| 211 } | 210 } |
| 212 } | 211 } |
| 213 load_disable_cache_ = config_->load_disable_cache; | 212 load_disable_cache_ = config_->load_disable_cache; |
| 214 config_.reset(NULL); | 213 config_.reset(NULL); |
| 215 | 214 |
| 216 if (VLOG_IS_ON(2)) { | 215 if (VLOG_IS_ON(2)) { |
| 217 net_log_observer_.reset(new NetLogObserver()); | 216 net_log_observer_.reset(new NetLogObserver()); |
| 218 context_->net_log()->AddThreadSafeObserver(net_log_observer_.get(), | 217 context_->net_log()->AddThreadSafeObserver(net_log_observer_.get(), |
| 219 net::NetLog::LOG_ALL_BUT_BYTES); | 218 net::NetLog::LOG_ALL_BUT_BYTES); |
| 220 } | 219 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 net_log_logger_.reset(); | 312 net_log_logger_.reset(); |
| 314 } | 313 } |
| 315 } | 314 } |
| 316 | 315 |
| 317 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { | 316 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { |
| 318 VLOG(2) << "Net log entry: type=" << entry.type() | 317 VLOG(2) << "Net log entry: type=" << entry.type() |
| 319 << ", source=" << entry.source().type << ", phase=" << entry.phase(); | 318 << ", source=" << entry.source().type << ", phase=" << entry.phase(); |
| 320 } | 319 } |
| 321 | 320 |
| 322 } // namespace cronet | 321 } // namespace cronet |
| OLD | NEW |