| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 if (quic_hint.alternate_port <= std::numeric_limits<uint16>::min() || | 180 if (quic_hint.alternate_port <= std::numeric_limits<uint16>::min() || |
| 181 quic_hint.alternate_port > std::numeric_limits<uint16>::max()) { | 181 quic_hint.alternate_port > std::numeric_limits<uint16>::max()) { |
| 182 LOG(ERROR) << "Invalid QUIC hint alternate port: " | 182 LOG(ERROR) << "Invalid QUIC hint alternate port: " |
| 183 << quic_hint.alternate_port; | 183 << quic_hint.alternate_port; |
| 184 continue; | 184 continue; |
| 185 } | 185 } |
| 186 | 186 |
| 187 net::HostPortPair quic_hint_host_port_pair(canon_host, | 187 net::HostPortPair quic_hint_host_port_pair(canon_host, |
| 188 quic_hint.port); | 188 quic_hint.port); |
| 189 context_->http_server_properties()->SetAlternateProtocol( | 189 context_->http_server_properties()->AddAlternateProtocol( |
| 190 quic_hint_host_port_pair, | 190 quic_hint_host_port_pair, |
| 191 static_cast<uint16>(quic_hint.alternate_port), | 191 static_cast<uint16>(quic_hint.alternate_port), |
| 192 net::AlternateProtocol::QUIC, | 192 net::AlternateProtocol::QUIC, 1.0f); |
| 193 1.0f); | |
| 194 } | 193 } |
| 195 } | 194 } |
| 196 load_disable_cache_ = config_->load_disable_cache; | 195 load_disable_cache_ = config_->load_disable_cache; |
| 197 config_.reset(NULL); | 196 config_.reset(NULL); |
| 198 | 197 |
| 199 if (VLOG_IS_ON(2)) { | 198 if (VLOG_IS_ON(2)) { |
| 200 net_log_observer_.reset(new NetLogObserver()); | 199 net_log_observer_.reset(new NetLogObserver()); |
| 201 context_->net_log()->AddThreadSafeObserver(net_log_observer_.get(), | 200 context_->net_log()->AddThreadSafeObserver(net_log_observer_.get(), |
| 202 net::NetLog::LOG_ALL_BUT_BYTES); | 201 net::NetLog::LOG_ALL_BUT_BYTES); |
| 203 } | 202 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 net_log_logger_.reset(); | 295 net_log_logger_.reset(); |
| 297 } | 296 } |
| 298 } | 297 } |
| 299 | 298 |
| 300 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { | 299 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { |
| 301 VLOG(2) << "Net log entry: type=" << entry.type() | 300 VLOG(2) << "Net log entry: type=" << entry.type() |
| 302 << ", source=" << entry.source().type << ", phase=" << entry.phase(); | 301 << ", source=" << entry.source().type << ", phase=" << entry.phase(); |
| 303 } | 302 } |
| 304 | 303 |
| 305 } // namespace cronet | 304 } // namespace cronet |
| OLD | NEW |