| 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/cronet_url_request_context_adapter.h" | 5 #include "components/cronet/android/cronet_url_request_context_adapter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "components/cronet/url_request_context_config.h" | 10 #include "components/cronet/url_request_context_config.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 180 |
| 181 if (quic_hint.alternate_port <= std::numeric_limits<uint16>::min() || | 181 if (quic_hint.alternate_port <= std::numeric_limits<uint16>::min() || |
| 182 quic_hint.alternate_port > std::numeric_limits<uint16>::max()) { | 182 quic_hint.alternate_port > std::numeric_limits<uint16>::max()) { |
| 183 LOG(ERROR) << "Invalid QUIC hint alternate port: " | 183 LOG(ERROR) << "Invalid QUIC hint alternate port: " |
| 184 << quic_hint.alternate_port; | 184 << quic_hint.alternate_port; |
| 185 continue; | 185 continue; |
| 186 } | 186 } |
| 187 | 187 |
| 188 net::HostPortPair quic_hint_host_port_pair(canon_host, | 188 net::HostPortPair quic_hint_host_port_pair(canon_host, |
| 189 quic_hint.port); | 189 quic_hint.port); |
| 190 context_->http_server_properties()->SetAlternateProtocol( | 190 context_->http_server_properties()->AddAlternateProtocol( |
| 191 quic_hint_host_port_pair, | 191 quic_hint_host_port_pair, |
| 192 static_cast<uint16>(quic_hint.alternate_port), | 192 static_cast<uint16>(quic_hint.alternate_port), |
| 193 net::AlternateProtocol::QUIC, | 193 net::AlternateProtocol::QUIC, 1.0f); |
| 194 1.0f); | |
| 195 } | 194 } |
| 196 } | 195 } |
| 197 | 196 |
| 198 java_init_network_thread.Run(); | 197 java_init_network_thread.Run(); |
| 199 } | 198 } |
| 200 | 199 |
| 201 void CronetURLRequestContextAdapter::Destroy() { | 200 void CronetURLRequestContextAdapter::Destroy() { |
| 202 DCHECK(!GetNetworkTaskRunner()->BelongsToCurrentThread()); | 201 DCHECK(!GetNetworkTaskRunner()->BelongsToCurrentThread()); |
| 203 // Stick network_thread_ in a local, as |this| may be destroyed from the | 202 // Stick network_thread_ in a local, as |this| may be destroyed from the |
| 204 // network thread before delete network_thread is called. | 203 // network thread before delete network_thread is called. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 255 |
| 257 void CronetURLRequestContextAdapter::StopNetLogOnNetworkThread() { | 256 void CronetURLRequestContextAdapter::StopNetLogOnNetworkThread() { |
| 258 DCHECK(GetNetworkTaskRunner()->BelongsToCurrentThread()); | 257 DCHECK(GetNetworkTaskRunner()->BelongsToCurrentThread()); |
| 259 if (net_log_logger_) { | 258 if (net_log_logger_) { |
| 260 net_log_logger_->StopObserving(); | 259 net_log_logger_->StopObserving(); |
| 261 net_log_logger_.reset(); | 260 net_log_logger_.reset(); |
| 262 } | 261 } |
| 263 } | 262 } |
| 264 | 263 |
| 265 } // namespace cronet | 264 } // namespace cronet |
| OLD | NEW |