Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: net/http/http_stream_factory_impl.cc

Issue 1137073003: Add a new disable_insecure_quic finch parameter to disable insecure QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/http_network_session.cc ('k') | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/http/http_network_session.cc ('k') | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698