ChromeResourceDispatcherHostDelegateBrowserTest.PolicyHeader
ChromeResourceDispatcherHostDelegateBrowserTest.PolicyHeaderForRedirect
are tests to ensure that PolicyHeaderIOHelper::AddPolicyHeaders adds the correct headers for requests to a specific URL (DMServer).
This functionality was added in
https://codereview.chromium.org/99433004
https://codereview.chromium.org/307653006
PolicyHeaderIOHelper is currently called by ChromeResourceDispatcherHostDelegate, which isn't compatible with the network service (as net/ will be running in a different process).
The URL that's passed to PolicyHeaderIOHelper appears to be used in two places: net::URLFetcher in DeviceManagementService::StartJob and navigating a WebContents in ArcActiveDirectoryEnrollmentTokenFetcher::InitiateSamlFlow.
To figure out the best way to solve this, there are a few open questions:
1) The Arc use case came much later, so I'm wondering if the original implementation used ResourceDispatcherHost hooks (as opposed to just adding the header always in DeviceManagementRequestJobImpl::ConfigureRequest) because even then the user could navigate to that URL?
2) do we need to set this header on subresources (i.e. image, JS, stylesheets) or just frames and the URLFetcher?
If we need it just for frames and URLFetcher, that'd be easiest. We could then add the header in a ContentBrowserClient::NavigationRequestStarted for navigations and in DeviceManagementRequestJobImpl::ConfigureRequest for the fetcher.
Comment 1 by mmenke@chromium.org
, Apr 13 2018