Navigation Request Headers

363 views
Skip to first unread message

Giovanni Ortuño

unread,
Aug 9, 2024, 12:23:30 PM8/9/24
to navigat...@chromium.org

Hi!

I'm trying to gather metrics about the size of top level requests, including the size of the request line, the size of the headers, etc. Any pointers to where I could get this data in chromium?

I've looked at NavigationHandle but the HttpRequestHeader member is missing a lot of headers that show up in DevTools, e.g. the Cookie header. I tried to look at what DevTools does to get all the headers but couldn't figure it out.

Any pointers would be really appreciated!

Gio

Nasko Oskov

unread,
Aug 12, 2024, 7:37:14 PM8/12/24
to Giovanni Ortuño, navigat...@chromium.org
Hey Gio,
I don't have a good answer to your question, as I haven't looked at this area in a long time and haven't had a chance to look under the debugger, but I would expect to see most headers in the BeginNavigationParams struct which has a headers member. For example, a bunch of headers get populated here - https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/navigation_request.cc;l=1922-2009;drc=5203366d4cf174b9331ee33563e0520f10b60828.

In general, I would expect there is also a hook in the network stack you can use, but you didn't specify whether you need this in a specific component/layer of the code.

Thanks!
Nasko

--
You received this message because you are subscribed to the Google Groups "navigation-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to navigation-de...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/navigation-dev/CAMDKGBVb_xa0VLEs6-GVLbhyEK6yu5b4UecWT4mT2Ch4MZwYFQ%40mail.gmail.com.

Giovanni Ortuño

unread,
Aug 13, 2024, 11:13:04 AM8/13/24
to Nasko Oskov, navigat...@chromium.org
Thanks for the pointers, Nasko!

Unfortunately, BeginNavigationParams is missing some headers that seemed to be added further down the stack.

I was able to get the information through UrlLoader::SetRawRequestHeadersAndNotify() which gets called after the headers I need, e.g. Cookie, get built way further down the stack.

Thanks again!

Gio
Reply all
Reply to author
Forward
0 new messages