Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 continue; | 189 continue; |
| 190 } | 190 } |
| 191 | 191 |
| 192 if (quic_hint.alternate_port <= std::numeric_limits<uint16_t>::min() || | 192 if (quic_hint.alternate_port <= std::numeric_limits<uint16_t>::min() || |
| 193 quic_hint.alternate_port > std::numeric_limits<uint16_t>::max()) { | 193 quic_hint.alternate_port > std::numeric_limits<uint16_t>::max()) { |
| 194 LOG(ERROR) << "Invalid QUIC hint alternate port: " | 194 LOG(ERROR) << "Invalid QUIC hint alternate port: " |
| 195 << quic_hint.alternate_port; | 195 << quic_hint.alternate_port; |
| 196 continue; | 196 continue; |
| 197 } | 197 } |
| 198 | 198 |
| 199 net::HostPortPair quic_hint_host_port_pair(canon_host, | 199 url::SchemeHostPort quic_server("https", canon_host, quic_hint.port); |
|
mmenke
2016/04/21 18:52:34
include url/scheme_host_port.h
Zhongyi Shi
2016/04/21 19:44:29
Done.
| |
| 200 quic_hint.port); | |
| 201 net::AlternativeService alternative_service( | 200 net::AlternativeService alternative_service( |
| 202 net::AlternateProtocol::QUIC, "", | 201 net::AlternateProtocol::QUIC, "", |
| 203 static_cast<uint16_t>(quic_hint.alternate_port)); | 202 static_cast<uint16_t>(quic_hint.alternate_port)); |
| 204 context_->http_server_properties()->SetAlternativeService( | 203 context_->http_server_properties()->SetAlternativeService( |
| 205 quic_hint_host_port_pair, alternative_service, base::Time::Max()); | 204 quic_server, alternative_service, base::Time::Max()); |
| 206 } | 205 } |
| 207 } | 206 } |
| 208 load_disable_cache_ = config_->load_disable_cache; | 207 load_disable_cache_ = config_->load_disable_cache; |
| 209 config_.reset(NULL); | 208 config_.reset(NULL); |
| 210 | 209 |
| 211 if (VLOG_IS_ON(2)) { | 210 if (VLOG_IS_ON(2)) { |
| 212 net_log_observer_.reset(new NetLogObserver()); | 211 net_log_observer_.reset(new NetLogObserver()); |
| 213 context_->net_log()->DeprecatedAddObserver( | 212 context_->net_log()->DeprecatedAddObserver( |
| 214 net_log_observer_.get(), | 213 net_log_observer_.get(), |
| 215 net::NetLogCaptureMode::IncludeCookiesAndCredentials()); | 214 net::NetLogCaptureMode::IncludeCookiesAndCredentials()); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 314 write_to_file_observer_.reset(); | 313 write_to_file_observer_.reset(); |
| 315 } | 314 } |
| 316 } | 315 } |
| 317 | 316 |
| 318 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { | 317 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { |
| 319 VLOG(2) << "Net log entry: type=" << entry.type() | 318 VLOG(2) << "Net log entry: type=" << entry.type() |
| 320 << ", source=" << entry.source().type << ", phase=" << entry.phase(); | 319 << ", source=" << entry.source().type << ", phase=" << entry.phase(); |
| 321 } | 320 } |
| 322 | 321 |
| 323 } // namespace cronet | 322 } // namespace cronet |
| OLD | NEW |