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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 1540463003: Change the interface of GetAlternativeServicesFor, always return the best Alt-Svc entry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Query quic_stream_factory to select preferred alt svc Created 5 years 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 side-by-side diff with in-line comments
Download patch
« net/quic/quic_stream_factory.h ('K') | « net/quic/quic_stream_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_factory.cc
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index 2443381e3e4f20654a2aba7b839876f455279a42..043d4bcdc635e294fdafad668a4bca2afd87f845 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -25,7 +25,6 @@
#include "net/cert/ct_verifier.h"
#include "net/dns/host_resolver.h"
#include "net/dns/single_request_host_resolver.h"
-#include "net/http/http_server_properties.h"
#include "net/quic/crypto/channel_id_chromium.h"
#include "net/quic/crypto/proof_verifier_chromium.h"
#include "net/quic/crypto/properties_based_quic_server_info.h"
@@ -707,6 +706,21 @@ void QuicStreamFactory::set_quic_server_info_factory(
quic_server_info_factory_.reset(quic_server_info_factory);
}
+bool QuicStreamFactory::CanPool(HostPortPair host_port_pair,
+ PrivacyMode privacy_mode,
+ StringPiece origin_host) {
+ QuicServerId server_id(host_port_pair, privacy_mode);
+ if (!active_sessions_.empty()) {
+ SessionMap::iterator it = active_sessions_.find(server_id);
+ if (it != active_sessions_.end()) {
+ QuicChromiumClientSession* session = it->second;
+ if (session->CanPool(origin_host.as_string(), privacy_mode))
+ return true;
+ }
+ }
Ryan Hamilton 2015/12/18 17:52:51 I'm a bit fan of early return instead of nesting,
+ return false;
+}
+
int QuicStreamFactory::Create(const HostPortPair& host_port_pair,
PrivacyMode privacy_mode,
int cert_verify_flags,
« net/quic/quic_stream_factory.h ('K') | « net/quic/quic_stream_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698