Commit 110e49f4 authored by Ryan Hamilton's avatar Ryan Hamilton Committed by Commit Bot

Log the alternative services that are found by the JobController in net-internals.

t=17922 [st= 4]    HTTP_STREAM_JOB_CONTROLLER_ALT_SVC_FOUND
                   --> alt_svc = "quic www.google.com:443, expires 2019-02-13 14:31:44"
                   --> is_broken = false

Change-Id: Ib312b4ef7f3e0fdd4e0e9e8396ebe37bd5847f13
Reviewed-on: https://chromium-review.googlesource.com/c/1410125
Commit-Queue: Ryan Hamilton <rch@chromium.org>
Reviewed-by: default avatarZhongyi Shi <zhongyi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622969}
parent 96ab0c89
......@@ -57,6 +57,16 @@ std::unique_ptr<base::Value> NetLogJobControllerCallback(
return std::move(dict);
}
std::unique_ptr<base::Value> NetLogAltSvcCallback(
const AlternativeServiceInfo* alt_svc_info,
bool is_broken,
NetLogCaptureMode /* capture_mode */) {
auto dict = std::make_unique<base::DictionaryValue>();
dict->SetString("alt_svc", alt_svc_info->ToString());
dict->SetBoolean("is_broken", is_broken);
return std::move(dict);
}
HttpStreamFactory::JobController::JobController(
HttpStreamFactory* factory,
HttpStreamRequest::Delegate* delegate,
......@@ -1149,8 +1159,13 @@ HttpStreamFactory::JobController::GetAlternativeServiceInfoInternal(
DCHECK(IsAlternateProtocolValid(alternative_service_info.protocol()));
if (!quic_advertised && alternative_service_info.protocol() == kProtoQUIC)
quic_advertised = true;
if (http_server_properties.IsAlternativeServiceBroken(
alternative_service_info.alternative_service())) {
const bool is_broken = http_server_properties.IsAlternativeServiceBroken(
alternative_service_info.alternative_service());
net_log_.AddEvent(
NetLogEventType::HTTP_STREAM_JOB_CONTROLLER_ALT_SVC_FOUND,
base::BindRepeating(&NetLogAltSvcCallback, &alternative_service_info,
is_broken));
if (is_broken) {
HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_BROKEN, false);
continue;
}
......
......@@ -1133,6 +1133,14 @@ EVENT_TYPE(HTTP_STREAM_JOB_CONTROLLER_BOUND)
// }
EVENT_TYPE(HTTP_STREAM_JOB_CONTROLLER_PROXY_SERVER_RESOLVED)
// Logs an alternative service found by the controller. The event parameters
// are:
// {
// "alt_svc": The alternative service.
// "broken": <boolean>
// }
EVENT_TYPE(HTTP_STREAM_JOB_CONTROLLER_ALT_SVC_FOUND)
// ------------------------------------------------------------------------
// HttpNetworkTransaction
// ------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment