Network Service: Fix VariationsHttpHeadersBrowserTest.TestStrippingHeadersFromResourceRequest
Some major changes in this CL:
1. Adds an extra parameter "array<string>? to_be_removed_request_headers" to
URLLoader::FollowRedirect() so that the browser can pass in this information.
2. Adds a ModifyHeaderURLLoaderThrottle class which can add http headers through WillStartRequest()
and remove http headers through WillRedirectRequest().
3. Adds an extra parameter "std::vector<std::sgring>* to_be_removed_headers" to the
WillRedirectRequest() so that subclass can pass in the http headers to be removed.
4. Adds a member variable |to_be_removed_request_headers_| to ThrottlingURLLoader so that
ThrottlingURLLoader::OnReceiveRedirect() can store the to be removed headers there, and
ThrottlingURLLoader::FollowRedirect() can use that to remove headers by calling
URLLoader::FollowRedirect().
The design doc is at:
https://docs.google.com/document/d/1XAa0V_lKmiZWW7eBCcqdr4DCJSrPjhnvuqispxBGkUw/edit?pli=1
Bug: 841309
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I99b80811986714c21f17833b9ccb438f175d9939
Reviewed-on: https://chromium-review.googlesource.com/1086219
Commit-Queue: Jun Cai <[email protected]>
Reviewed-by: Tom Sepez <[email protected]>
Reviewed-by: John Abd-El-Malek <[email protected]>
Reviewed-by: Matt Menke <[email protected]>
Cr-Commit-Position: refs/heads/master@{#566607}
diff --git a/content/browser/file_url_loader_factory.cc b/content/browser/file_url_loader_factory.cc
index 8bfb109..44eb5224 100644
--- a/content/browser/file_url_loader_factory.cc
+++ b/content/browser/file_url_loader_factory.cc
@@ -107,7 +107,9 @@
}
// network::mojom::URLLoader:
- void FollowRedirect(const base::Optional<net::HttpRequestHeaders>&
+ void FollowRedirect(const base::Optional<std::vector<std::string>>&
+ to_be_removed_request_headers,
+ const base::Optional<net::HttpRequestHeaders>&
modified_request_headers) override {}
void ProceedWithResponse() override { NOTREACHED(); }
void SetPriority(net::RequestPriority priority,
@@ -316,7 +318,9 @@
}
// network::mojom::URLLoader:
- void FollowRedirect(const base::Optional<net::HttpRequestHeaders>&
+ void FollowRedirect(const base::Optional<std::vector<std::string>>&
+ to_be_removed_request_headers,
+ const base::Optional<net::HttpRequestHeaders>&
modified_request_headers) override {}
void ProceedWithResponse() override {}
void SetPriority(net::RequestPriority priority,