Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h

Issue 2566773002: Add Brotli to Accept Encoding header for secure DRP requests (Closed)
Patch Set: Fix test Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h
index fa56f3ce7e64ea0a141b253a468bb7b8d7445e83..c1b51635e799ae1958ced5382a267a06f41f8725 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h
@@ -87,6 +87,8 @@ class DataReductionProxyNetworkDelegate : public net::LayeredNetworkDelegate {
std::unique_ptr<DataUseGroupProvider> data_use_group_provider);
private:
+ friend class DataReductionProxyTestContext;
+
// Resets if Lo-Fi has been used for the last main frame load to false.
void OnBeforeURLRequestInternal(net::URLRequest* request,
const net::CompletionCallback& callback,
@@ -153,6 +155,13 @@ class DataReductionProxyNetworkDelegate : public net::LayeredNetworkDelegate {
const net::ProxyInfo& proxy_info,
const net::ProxyRetryInfoMap& proxy_retry_info) const;
+ // May add Brotli to Accept Encoding request header if |proxy_info| contains
+ // a proxy server that is expected to support Brotli encoding.
+ void MaybeAddBrotliToAcceptEncodingHeader(
+ const net::ProxyInfo& proxy_info,
+ net::HttpRequestHeaders* request_headers,
+ const net::URLRequest& request) const;
+
// Total size of all content that has been received over the network.
int64_t total_received_bytes_;
@@ -172,6 +181,10 @@ class DataReductionProxyNetworkDelegate : public net::LayeredNetworkDelegate {
std::unique_ptr<DataUseGroupProvider> data_use_group_provider_;
+ // If |exclude_chrome_proxy_header_for_testing_| is set to true, chrome-proxy
+ // header would not be added to the request headers.
+ bool exclude_chrome_proxy_header_for_testing_;
+
base::ThreadChecker thread_checker_;
DISALLOW_COPY_AND_ASSIGN(DataReductionProxyNetworkDelegate);

Powered by Google App Engine
This is Rietveld 408576698