OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/http/http_stream_factory_impl.h" | 5 #include "net/http/http_stream_factory_impl.h" |
6 | 6 |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 #include "net/base/net_log.h" | 10 #include "net/base/net_log.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 origin.set_port(alternate.port); | 182 origin.set_port(alternate.port); |
183 if (alternate.protocol >= NPN_SPDY_2 && alternate.protocol <= NPN_SPDY_3) { | 183 if (alternate.protocol >= NPN_SPDY_2 && alternate.protocol <= NPN_SPDY_3) { |
184 if (!spdy_enabled()) | 184 if (!spdy_enabled()) |
185 return kNoAlternateProtocol; | 185 return kNoAlternateProtocol; |
186 | 186 |
187 if (HttpStreamFactory::HasSpdyExclusion(origin)) | 187 if (HttpStreamFactory::HasSpdyExclusion(origin)) |
188 return kNoAlternateProtocol; | 188 return kNoAlternateProtocol; |
189 | 189 |
190 *alternate_url = UpgradeUrlToHttps(original_url, alternate.port); | 190 *alternate_url = UpgradeUrlToHttps(original_url, alternate.port); |
191 } else { | 191 } else { |
192 DCHECK_EQ(QUIC_1, alternate.protocol); | 192 DCHECK_EQ(QUIC, alternate.protocol); |
193 if (!session_->params().enable_quic || | 193 if (!session_->params().enable_quic || |
194 !original_url.SchemeIs("http")) | 194 !original_url.SchemeIs("http")) |
195 return kNoAlternateProtocol; | 195 return kNoAlternateProtocol; |
196 // TODO(rch): Figure out how to make QUIC iteract with PAC | 196 // TODO(rch): Figure out how to make QUIC iteract with PAC |
197 // scripts. By not re-writing the URL, we will query the PAC script | 197 // scripts. By not re-writing the URL, we will query the PAC script |
198 // for the proxy to use to reach the original URL via TCP. But | 198 // for the proxy to use to reach the original URL via TCP. But |
199 // the alternate request will be going via UDP to a different port. | 199 // the alternate request will be going via UDP to a different port. |
200 *alternate_url = original_url; | 200 *alternate_url = original_url; |
201 } | 201 } |
202 return alternate; | 202 return alternate; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 it != requests_to_fail.end(); ++it) { | 287 it != requests_to_fail.end(); ++it) { |
288 Request* request = *it; | 288 Request* request = *it; |
289 if (request == request_map_[job]) { | 289 if (request == request_map_[job]) { |
290 continue; | 290 continue; |
291 } | 291 } |
292 request->OnStreamFailed(NULL, status, used_ssl_config); | 292 request->OnStreamFailed(NULL, status, used_ssl_config); |
293 } | 293 } |
294 } | 294 } |
295 | 295 |
296 } // namespace net | 296 } // namespace net |
OLD | NEW |