New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 656179 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 648648



Sign in to add a comment

RenderFrameImpl::willStartRequest attaches *navigational* things to *subresource* requests

Project Member Reported by lukasza@chromium.org, Oct 14 2016

Issue description

RenderFrameImpl::willStartRequest will attach navigation_state->start_params().extra_headers to requests for subresources.  This is wrong (the headers should only apply to navigational requests).

We should also audit other things that are propagated by RenderFrameImpl::willStartRequest - for example:
- transferred_request_child_id and transferred_request_request_id
- ui::PageTransition
- allow_download

This bug (extra_headers) is a root cause of  issue 655568 .
 
Cc: csharrison@chromium.org
I started a CL that does this but ended up dropping it on the floor. Thank you for taking on this work! In fact iterating through the headers can be quite expensive so this will be a perf win.

This is probably best owned by navigation experts, as I wasn't entirely sure which code was only used for navigations.
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 18 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4246472c00afcf4f7e7c55317d6988d158e83e11

commit 4246472c00afcf4f7e7c55317d6988d158e83e11
Author: lukasza <lukasza@chromium.org>
Date: Tue Oct 18 15:43:42 2016

LoadURLParams::extra_headers should not apply to subresource requests.

Extra http request headers specified in
NavigationController::LoadURLParams should only apply to the *navigation*
request trigerred by NavigationController::LoadURLWithParams method and
should NOT apply to http requests for *subresources*.

BUG=656179
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2429623002
Cr-Commit-Position: refs/heads/master@{#425972}

[modify] https://crrev.com/4246472c00afcf4f7e7c55317d6988d158e83e11/content/browser/frame_host/navigation_controller_impl_browsertest.cc
[modify] https://crrev.com/4246472c00afcf4f7e7c55317d6988d158e83e11/content/renderer/render_frame_impl.cc

Cc: clamy@chromium.org
Status update after chatting with creis@:

- Having navigation-specific and subresource-specific helper methods (instead of everything being handled inside a big willStartRequest) sounds good, but seems low priority (because with PlzNavigate the navigational requests won't go through RenderFrameImpl::willStartRequest anyway, right? +clamy@).

- transferred_request_child_id and transferred_request_request_id 1) should be applied only to navigational requests in RenderFrameImpl::willStartRequest and 2) we should double-check on the browser-side - before calling CompleteTransfer in ResourceDispatcherHostImpl::BeginRequest.  Ideally we will want to add some kind of test coverage here, but this might be tricky given that this requires a race.  +nick@ in case this is somehow related to  issue 655114 .

- ui::PageTransition - unclear if this should only apply to navigational requests.  This piece of data ends up being inspected in ResourceRequestPolicy::CanRequestResource (but then this is only called from ChromeExtensionsRendererClient::WillSendRequest if extensions are enabled?).

- allow_download - unclear what this is - might need more investigation.


csharrison@ - would you still have the CL draft you mentioned in #c1 (and/or notes on which things should only apply to navigational requests)?
Cc: nick@chromium.org
The CL is here:
https://chromiumcodereview.appspot.com/2356093002

Note: this was a rush job and I didn't end up finishing. Take it with a grain of salt (also, tests fail...).

Note: ui::PageTransition: This is needed for subresource requests, unfortunately. To see callers check  ResourceRequestInfo{Impl}::GetPageTransition. I'm not sure about allow_download (maybe needed for <a download>?).
Doing a bit of refactoring in ResourceRequests and I noticed that the call to addHTTPOriginIfNeeded should only be for main frame navigation requests, as we add the header in ResourceFetcher::addAdditionalRequestHeaders for all requests that are not for the main resource.
Cc: lukasza@chromium.org
Owner: ----
Status: Available (was: Started)
I don't have any more immediate plans for changes related to this (to ensuring that navigational "things" are not used by RenderFrameImpl::willStartRequest for non-navigational (e.g. subresource) requests.  Therefore - marking the bug as available.
Project Member

Comment 9 by sheriffbot@chromium.org, Oct 30 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 10 by nasko@chromium.org, Oct 30 2017

Labels: -Hotlist-Recharge-Cold Proj-PlzNavigate
This might be a moot point as we remove the old navigation path, so tagging with PlzNavigate to ensure we follow up on this.
Instead of moving the navigation code to another method, we can just delete it :)

Sign in to add a comment