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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 return kNoAlternativeService; | 190 return kNoAlternativeService; |
191 | 191 |
192 return alternative_service; | 192 return alternative_service; |
193 } | 193 } |
194 | 194 |
195 DCHECK_EQ(QUIC, alternative_service.protocol); | 195 DCHECK_EQ(QUIC, alternative_service.protocol); |
196 // TODO(bnc): Make sure that certificate requirements are enforced when using | 196 // TODO(bnc): Make sure that certificate requirements are enforced when using |
197 // QUIC, then remove the following two lines. | 197 // QUIC, then remove the following two lines. |
198 if (alternative_service.host != origin.host()) | 198 if (alternative_service.host != origin.host()) |
199 return kNoAlternativeService; | 199 return kNoAlternativeService; |
| 200 |
200 if (!session_->params().enable_quic) | 201 if (!session_->params().enable_quic) |
201 return kNoAlternativeService; | 202 return kNoAlternativeService; |
202 | 203 |
203 if (session_->quic_stream_factory()->IsQuicDisabled(origin.port())) | 204 if (session_->quic_stream_factory()->IsQuicDisabled(origin.port())) |
204 return kNoAlternativeService; | 205 return kNoAlternativeService; |
205 | 206 |
| 207 if (session_->params().disable_insecure_quic && |
| 208 !original_url.SchemeIs("https")) { |
| 209 return kNoAlternativeService; |
| 210 } |
| 211 |
206 return alternative_service; | 212 return alternative_service; |
207 } | 213 } |
208 | 214 |
209 void HttpStreamFactoryImpl::OrphanJob(Job* job, const Request* request) { | 215 void HttpStreamFactoryImpl::OrphanJob(Job* job, const Request* request) { |
210 DCHECK(ContainsKey(request_map_, job)); | 216 DCHECK(ContainsKey(request_map_, job)); |
211 DCHECK_EQ(request_map_[job], request); | 217 DCHECK_EQ(request_map_[job], request); |
212 DCHECK(!ContainsKey(orphaned_job_set_, job)); | 218 DCHECK(!ContainsKey(orphaned_job_set_, job)); |
213 | 219 |
214 request_map_.erase(job); | 220 request_map_.erase(job); |
215 | 221 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 delete job; | 271 delete job; |
266 } | 272 } |
267 | 273 |
268 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { | 274 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { |
269 preconnect_job_set_.erase(job); | 275 preconnect_job_set_.erase(job); |
270 delete job; | 276 delete job; |
271 OnPreconnectsCompleteInternal(); | 277 OnPreconnectsCompleteInternal(); |
272 } | 278 } |
273 | 279 |
274 } // namespace net | 280 } // namespace net |
OLD | NEW |