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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 48893003: QUIC - added googlevideo.com to the list of cannonical hostnames to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merging with tip Created 7 years, 1 month 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
« no previous file with comments | « net/quic/quic_stream_factory.h ('k') | net/quic/quic_stream_factory_test.cc » ('j') | 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 4df96103b51cc6c13ee3e5b6df9f5761d5ac18f5..e4578d36e6e70459934b277eb898b100ebfe4f14 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -31,6 +31,9 @@
#include "net/quic/quic_protocol.h"
#include "net/socket/client_socket_factory.h"
+using std::string;
+using std::vector;
+
namespace net {
// Responsible for creating a new QUIC session to the specified server, and
@@ -256,6 +259,8 @@ QuicStreamFactory::QuicStreamFactory(
config_.set_idle_connection_state_lifetime(
QuicTime::Delta::FromSeconds(30),
QuicTime::Delta::FromSeconds(30));
+ cannoncial_suffixes_.push_back(string(".c.youtube.com"));
+ cannoncial_suffixes_.push_back(string(".googlevideo.com"));
}
QuicStreamFactory::~QuicStreamFactory() {
@@ -506,12 +511,17 @@ void QuicStreamFactory::PopulateFromCanonicalConfig(
const HostPortProxyPair& host_port_proxy_pair,
QuicCryptoClientConfig* crypto_config) {
const string server_hostname = host_port_proxy_pair.first.host();
- const string kYouTubeSuffix(".c.youtube.com");
- if (!EndsWith(server_hostname, kYouTubeSuffix, false)) {
- return;
+
+ unsigned i = 0;
+ for (; i < cannoncial_suffixes_.size(); ++i) {
+ if (EndsWith(server_hostname, cannoncial_suffixes_[i], false)) {
+ break;
+ }
}
+ if (i == cannoncial_suffixes_.size())
+ return;
- HostPortPair canonical_host_port(kYouTubeSuffix,
+ HostPortPair canonical_host_port(cannoncial_suffixes_[i],
host_port_proxy_pair.first.port());
if (!ContainsKey(canonical_hostname_to_origin_map_, canonical_host_port)) {
// This is the first host we've seen which matches the suffix, so make it
« no previous file with comments | « net/quic/quic_stream_factory.h ('k') | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698