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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 1018943002: Update HttpServerProperties::*AlternateProtocol* interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_stream_factory.cc
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index 2e8508d7629c8b3544862762e524d087b54e8729..156adf53b87a609879b656796382e73e44bfc3b4 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -646,7 +646,7 @@ int QuicStreamFactory::Create(const HostPortPair& host_port_pair,
}
scoped_ptr<Job> job(new Job(this, host_resolver_, host_port_pair, is_https,
- WasAlternateProtocolRecentlyBroken(server_id),
+ WasAlternativeServiceRecentlyBroken(server_id),
privacy_mode, method == "POST" /* is_post */,
quic_server_info, net_log));
int rv = job->Run(base::Bind(&QuicStreamFactory::OnJobComplete,
@@ -669,7 +669,7 @@ void QuicStreamFactory::CreateAuxilaryJob(const QuicServerId server_id,
const BoundNetLog& net_log) {
Job* aux_job = new Job(this, host_resolver_, server_id.host_port_pair(),
server_id.is_https(),
- WasAlternateProtocolRecentlyBroken(server_id),
+ WasAlternativeServiceRecentlyBroken(server_id),
server_id.privacy_mode(), is_post, nullptr, net_log);
active_jobs_[server_id].insert(aux_job);
task_runner_->PostTask(FROM_HERE,
@@ -1063,11 +1063,15 @@ int64 QuicStreamFactory::GetServerNetworkStatsSmoothedRttInMicroseconds(
return stats->srtt.InMicroseconds();
}
-bool QuicStreamFactory::WasAlternateProtocolRecentlyBroken(
+bool QuicStreamFactory::WasAlternativeServiceRecentlyBroken(
const QuicServerId& server_id) const {
- return http_server_properties_ &&
- http_server_properties_->WasAlternateProtocolRecentlyBroken(
- server_id.host_port_pair());
+ if (!http_server_properties_)
+ return false;
+ const AlternativeService alternative_service(
+ QUIC, server_id.host_port_pair().host(),
+ server_id.host_port_pair().port());
Ryan Hamilton 2015/03/18 22:55:43 You could also add a 2-arg constructor which takes
Bence 2015/03/19 12:45:39 Excellent idea. Done.
+ return http_server_properties_->WasAlternativeServiceRecentlyBroken(
+ alternative_service);
}
bool QuicStreamFactory::CryptoConfigCacheIsEmpty(

Powered by Google App Engine
This is Rietveld 408576698