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

Side by Side Diff: net/quic/chromium/quic_stream_factory.cc

Issue 2363653002: Cleanup unreachable cert adding code (Closed)
Patch Set: Rebased Created 4 years, 2 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/quic/chromium/quic_stream_factory.h ('k') | net/quic/chromium/quic_stream_factory_test.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/quic/chromium/quic_stream_factory.h" 5 #include "net/quic/chromium/quic_stream_factory.h"
6 6
7 #include <openssl/aead.h> 7 #include <openssl/aead.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <tuple> 10 #include <tuple>
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 net_log.AddEvent(NetLogEventType::QUIC_CONNECTION_MIGRATION_SUCCESS, 1495 net_log.AddEvent(NetLogEventType::QUIC_CONNECTION_MIGRATION_SUCCESS,
1496 base::Bind(&NetLogQuicConnectionMigrationSuccessCallback, 1496 base::Bind(&NetLogQuicConnectionMigrationSuccessCallback,
1497 session->connection_id())); 1497 session->connection_id()));
1498 return MigrationResult::SUCCESS; 1498 return MigrationResult::SUCCESS;
1499 } 1499 }
1500 1500
1501 void QuicStreamFactory::OnSSLConfigChanged() { 1501 void QuicStreamFactory::OnSSLConfigChanged() {
1502 CloseAllSessions(ERR_CERT_DATABASE_CHANGED, QUIC_CONNECTION_CANCELLED); 1502 CloseAllSessions(ERR_CERT_DATABASE_CHANGED, QUIC_CONNECTION_CANCELLED);
1503 } 1503 }
1504 1504
1505 void QuicStreamFactory::OnCertAdded(const X509Certificate* cert) { 1505 void QuicStreamFactory::OnCertDBChanged(const X509Certificate* cert) {
1506 CloseAllSessions(ERR_CERT_DATABASE_CHANGED, QUIC_CONNECTION_CANCELLED);
1507 }
1508
1509 void QuicStreamFactory::OnCACertChanged(const X509Certificate* cert) {
1510 // We should flush the sessions if we removed trust from a 1506 // We should flush the sessions if we removed trust from a
1511 // cert, because a previously trusted server may have become 1507 // cert, because a previously trusted server may have become
1512 // untrusted. 1508 // untrusted.
1513 // 1509 //
1514 // We should not flush the sessions if we added trust to a cert. 1510 // We should not flush the sessions if we added trust to a cert.
1515 // 1511 //
1516 // Since the OnCACertChanged method doesn't tell us what 1512 // Since the OnCertDBChanged method doesn't tell us what
1517 // kind of change it is, we have to flush the socket 1513 // kind of change it is, we have to flush the socket
1518 // pools to be safe. 1514 // pools to be safe.
1519 CloseAllSessions(ERR_CERT_DATABASE_CHANGED, QUIC_CONNECTION_CANCELLED); 1515 CloseAllSessions(ERR_CERT_DATABASE_CHANGED, QUIC_CONNECTION_CANCELLED);
1520 } 1516 }
1521 1517
1522 bool QuicStreamFactory::HasActiveSession(const QuicServerId& server_id) const { 1518 bool QuicStreamFactory::HasActiveSession(const QuicServerId& server_id) const {
1523 // TODO(rtenneti): crbug.com/498823 - delete active_sessions_.empty() check. 1519 // TODO(rtenneti): crbug.com/498823 - delete active_sessions_.empty() check.
1524 if (active_sessions_.empty()) 1520 if (active_sessions_.empty())
1525 return false; 1521 return false;
1526 return base::ContainsKey(active_sessions_, server_id); 1522 return base::ContainsKey(active_sessions_, server_id);
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1907 void QuicStreamFactory::OpenFactory() { 1903 void QuicStreamFactory::OpenFactory() {
1908 status_ = OPEN; 1904 status_ = OPEN;
1909 } 1905 }
1910 1906
1911 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() { 1907 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() {
1912 if (status_ == OPEN) 1908 if (status_ == OPEN)
1913 consecutive_disabled_count_ = 0; 1909 consecutive_disabled_count_ = 0;
1914 } 1910 }
1915 1911
1916 } // namespace net 1912 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_stream_factory.h ('k') | net/quic/chromium/quic_stream_factory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698