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

Unified Diff: net/http/http_stream_factory_impl_job_controller.cc

Issue 2373663002: Unify enum NextProto and enum AlternateProtocol. (Closed)
Patch Set: Fix compile errors. Created 4 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
Index: net/http/http_stream_factory_impl_job_controller.cc
diff --git a/net/http/http_stream_factory_impl_job_controller.cc b/net/http/http_stream_factory_impl_job_controller.cc
index daff299b63777f36699ba447e5d64c508e2d6fe5..08a74fda82eb4d53b50f7afbdf8fe8d52c03b9e2 100644
--- a/net/http/http_stream_factory_impl_job_controller.cc
+++ b/net/http/http_stream_factory_impl_job_controller.cc
@@ -103,9 +103,9 @@ void HttpStreamFactoryImpl::JobController::Preconnect(
const AlternativeService alternative_service = GetAlternativeServiceFor(
request_info, nullptr, HttpStreamRequest::HTTP_STREAM);
- if (alternative_service.protocol != UNINITIALIZED_ALTERNATE_PROTOCOL) {
+ if (alternative_service.protocol != kProtoUnknown) {
if (session_->params().quic_disable_preconnect_if_0rtt &&
- alternative_service.protocol == QUIC &&
+ alternative_service.protocol == kProtoQUIC &&
session_->quic_stream_factory()->ZeroRTTEnabledFor(QuicServerId(
alternative_service.host_port_pair(), request_info.privacy_mode))) {
MaybeNotifyFactoryOfCompletion();
@@ -644,7 +644,7 @@ void HttpStreamFactoryImpl::JobController::CreateJobs(
const AlternativeService alternative_service =
GetAlternativeServiceFor(request_info, delegate, stream_type);
- if (alternative_service.protocol != UNINITIALIZED_ALTERNATE_PROTOCOL) {
+ if (alternative_service.protocol != kProtoUnknown) {
// Never share connection with other jobs for FTP requests.
DVLOG(1) << "Selected alternative service (host: "
<< alternative_service.host_port_pair().host()
@@ -787,8 +787,7 @@ void HttpStreamFactoryImpl::JobController::OnAlternativeJobFailed(Job* job) {
}
void HttpStreamFactoryImpl::JobController::ReportBrokenAlternativeService() {
- DCHECK(failed_alternative_service_.protocol !=
- UNINITIALIZED_ALTERNATE_PROTOCOL ||
+ DCHECK(failed_alternative_service_.protocol != kProtoUnknown ||
failed_alternative_proxy_server_.is_valid());
if (failed_alternative_proxy_server_.is_valid()) {
@@ -849,9 +848,9 @@ HttpStreamFactoryImpl::JobController::GetAlternativeServiceFor(
AlternativeService alternative_service =
GetAlternativeServiceForInternal(request_info, delegate, stream_type);
AlternativeServiceType type;
- if (alternative_service.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) {
+ if (alternative_service.protocol == kProtoUnknown) {
type = NO_ALTERNATIVE_SERVICE;
- } else if (alternative_service.protocol == QUIC) {
+ } else if (alternative_service.protocol == kProtoQUIC) {
if (request_info.url.host() == alternative_service.host) {
type = QUIC_SAME_DESTINATION;
} else {
@@ -896,7 +895,7 @@ HttpStreamFactoryImpl::JobController::GetAlternativeServiceForInternal(
for (const AlternativeService& alternative_service :
alternative_service_vector) {
DCHECK(IsAlternateProtocolValid(alternative_service.protocol));
- if (!quic_advertised && alternative_service.protocol == QUIC)
+ if (!quic_advertised && alternative_service.protocol == kProtoQUIC)
quic_advertised = true;
if (http_server_properties.IsAlternativeServiceBroken(
alternative_service)) {
@@ -917,7 +916,7 @@ HttpStreamFactoryImpl::JobController::GetAlternativeServiceForInternal(
origin.port() < kUnrestrictedPort))
continue;
- if (alternative_service.protocol == NPN_HTTP_2) {
+ if (alternative_service.protocol == kProtoHTTP2) {
if (origin.host() != alternative_service.host &&
!session_->params()
.enable_http2_alternative_service_with_different_host) {
@@ -925,13 +924,12 @@ HttpStreamFactoryImpl::JobController::GetAlternativeServiceForInternal(
}
// Cache this entry if we don't have a non-broken Alt-Svc yet.
- if (first_alternative_service.protocol ==
- UNINITIALIZED_ALTERNATE_PROTOCOL)
+ if (first_alternative_service.protocol == kProtoUnknown)
first_alternative_service = alternative_service;
continue;
}
- DCHECK_EQ(QUIC, alternative_service.protocol);
+ DCHECK_EQ(kProtoQUIC, alternative_service.protocol);
if (origin.host() != alternative_service.host &&
!session_->params()
.enable_quic_alternative_service_with_different_host) {
@@ -970,7 +968,7 @@ HttpStreamFactoryImpl::JobController::GetAlternativeServiceForInternal(
}
// Cache this entry if we don't have a non-broken Alt-Svc yet.
- if (first_alternative_service.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL)
+ if (first_alternative_service.protocol == kProtoUnknown)
first_alternative_service = alternative_service;
}
« no previous file with comments | « net/http/http_stream_factory_impl_job.cc ('k') | net/http/http_stream_factory_impl_job_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698