From 22876d1b74a4a5bf0422a7a808b4c597975607d2 Mon Sep 17 00:00:00 2001 From: Jelle Foks Date: Fri, 9 Aug 2024 11:20:29 -0700 Subject: [PATCH] Log negotiated protocol --- net/http/http_stream_factory_job.h | 1 + net/http/http_stream_factory_job_controller.cc | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/net/http/http_stream_factory_job.h b/net/http/http_stream_factory_job.h index 7938f9210ffe..80d6c4de79e9 100644 --- a/net/http/http_stream_factory_job.h +++ b/net/http/http_stream_factory_job.h @@ -221,6 +221,7 @@ class HttpStreamFactory::Job { void SetPriority(RequestPriority priority); + const GURL& origin_url() const { return origin_url_; } RequestPriority priority() const { return priority_; } bool was_alpn_negotiated() const; NextProto negotiated_protocol() const; diff --git a/net/http/http_stream_factory_job_controller.cc b/net/http/http_stream_factory_job_controller.cc index 1182cfe96ef8..3a5d2635b586 100644 --- a/net/http/http_stream_factory_job_controller.cc +++ b/net/http/http_stream_factory_job_controller.cc @@ -255,6 +255,17 @@ void HttpStreamFactory::JobController::OnStreamReady( std::unique_ptr stream = job->ReleaseStream(); DCHECK(stream); + { + const char* jobtypename[] = {"main", "alternative", "dns_alpn_h3", "preconnect", + "preconnect_dns_alpn_h3"}; + LOG(INFO) << __FUNCTION__ << " negotiated_protocol = " + << NextProtoToString(job->negotiated_protocol()) + << " was_alpn_negotiated=" << job->was_alpn_negotiated() + << " using_spdy=" << job->using_spdy() + << " using_quic=" << job->using_quic() + << " job_type=" << jobtypename[(int)job->job_type()] << " " + << job->origin_url().spec(); + } MarkRequestComplete(job->was_alpn_negotiated(), job->negotiated_protocol(), job->using_spdy());