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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 delete job; | 361 delete job; |
362 } | 362 } |
363 | 363 |
364 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { | 364 void HttpStreamFactoryImpl::OnPreconnectsComplete(const Job* job) { |
365 preconnect_job_set_.erase(job); | 365 preconnect_job_set_.erase(job); |
366 delete job; | 366 delete job; |
367 OnPreconnectsCompleteInternal(); | 367 OnPreconnectsCompleteInternal(); |
368 } | 368 } |
369 | 369 |
370 bool HttpStreamFactoryImpl::IsQuicWhitelistedForHost(const std::string& host) { | 370 bool HttpStreamFactoryImpl::IsQuicWhitelistedForHost(const std::string& host) { |
| 371 bool whitelist_needed = false; |
| 372 for (QuicVersion version : session_->params().quic_supported_versions) { |
| 373 if (version <= QUIC_VERSION_30) { |
| 374 whitelist_needed = true; |
| 375 break; |
| 376 } |
| 377 } |
| 378 |
| 379 // The QUIC whitelist is not needed in QUIC versions after 30. |
| 380 if (!whitelist_needed) |
| 381 return true; |
| 382 |
371 if (session_->params().transport_security_state->IsGooglePinnedHost(host)) | 383 if (session_->params().transport_security_state->IsGooglePinnedHost(host)) |
372 return true; | 384 return true; |
373 | 385 |
374 return ContainsKey(session_->params().quic_host_whitelist, | 386 return ContainsKey(session_->params().quic_host_whitelist, |
375 base::ToLowerASCII(host)); | 387 base::ToLowerASCII(host)); |
376 } | 388 } |
377 | 389 |
378 } // namespace net | 390 } // namespace net |
OLD | NEW |