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

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

Issue 875583003: Do not pool QUIC sessions when privacy mode mismatches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2272
Patch Set: Created 5 years, 11 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/quic_client_session_test.cc ('k') | no next file » | 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/quic_stream_factory.h" 5 #include "net/quic/quic_stream_factory.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/cpu.h" 9 #include "base/cpu.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 return rv; 699 return rv;
700 } 700 }
701 701
702 bool QuicStreamFactory::OnResolution( 702 bool QuicStreamFactory::OnResolution(
703 const QuicServerId& server_id, 703 const QuicServerId& server_id,
704 const AddressList& address_list) { 704 const AddressList& address_list) {
705 DCHECK(!HasActiveSession(server_id)); 705 DCHECK(!HasActiveSession(server_id));
706 if (disable_connection_pooling_) { 706 if (disable_connection_pooling_) {
707 return false; 707 return false;
708 } 708 }
709 for (size_t i = 0; i < address_list.size(); ++i) { 709 for (const IPEndPoint& address : address_list) {
710 const IPEndPoint& address = address_list[i];
711 const IpAliasKey ip_alias_key(address, server_id.is_https()); 710 const IpAliasKey ip_alias_key(address, server_id.is_https());
712 if (!ContainsKey(ip_aliases_, ip_alias_key)) 711 if (!ContainsKey(ip_aliases_, ip_alias_key))
713 continue; 712 continue;
714 713
715 const SessionSet& sessions = ip_aliases_[ip_alias_key]; 714 const SessionSet& sessions = ip_aliases_[ip_alias_key];
716 for (SessionSet::const_iterator i = sessions.begin(); 715 for (QuicClientSession* session : sessions) {
717 i != sessions.end(); ++i) { 716 if (!session->CanPool(server_id.host(), server_id.privacy_mode()))
718 QuicClientSession* session = *i;
719 if (!session->CanPool(server_id.host()))
720 continue; 717 continue;
721 active_sessions_[server_id] = session; 718 active_sessions_[server_id] = session;
722 session_aliases_[session].insert(server_id); 719 session_aliases_[session].insert(server_id);
723 return true; 720 return true;
724 } 721 }
725 } 722 }
726 return false; 723 return false;
727 } 724 }
728 725
729 void QuicStreamFactory::OnJobComplete(Job* job, int rv) { 726 void QuicStreamFactory::OnJobComplete(Job* job, int rv) {
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 http_server_properties_->ClearAlternateProtocol(server); 1220 http_server_properties_->ClearAlternateProtocol(server);
1224 http_server_properties_->SetAlternateProtocol( 1221 http_server_properties_->SetAlternateProtocol(
1225 server, alternate.port, alternate.protocol, 1); 1222 server, alternate.port, alternate.protocol, 1);
1226 DCHECK_EQ(QUIC, 1223 DCHECK_EQ(QUIC,
1227 http_server_properties_->GetAlternateProtocol(server).protocol); 1224 http_server_properties_->GetAlternateProtocol(server).protocol);
1228 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken( 1225 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken(
1229 server)); 1226 server));
1230 } 1227 }
1231 1228
1232 } // namespace net 1229 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_client_session_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698