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

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

Issue 2802463002: Adds feature flag for chrome-proxy-ect header (default off) (Closed)
Patch Set: Tweaked the name of the Feature to be more Feature like than Switch like. Created 3 years, 8 months 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
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
index b36fd93d5ee321020b87c31dd20c128ac4ca1e5c..7ac7108d46f5b533b6c3f9cd614d3e62311675f9 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
@@ -19,6 +19,7 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.h"
#include "components/data_reduction_proxy/core/browser/data_use_group.h"
#include "components/data_reduction_proxy/core/browser/data_use_group_provider.h"
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_features.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_util.h"
@@ -122,7 +123,9 @@ void VerifyHttpRequestHeaders(bool via_chrome_proxy,
const net::HttpRequestHeaders& headers) {
if (via_chrome_proxy) {
DCHECK(headers.HasHeader(chrome_proxy_header()));
- DCHECK(headers.HasHeader(chrome_proxy_ect_header()));
+ DCHECK_EQ(
+ data_reduction_proxy::features::IsDataReductionProxyECTHeaderEnabled(),
+ headers.HasHeader(chrome_proxy_ect_header()));
} else {
DCHECK(!headers.HasHeader(chrome_proxy_header()));
DCHECK(!headers.HasHeader(chrome_proxy_accept_transform_header()));
@@ -526,6 +529,9 @@ void DataReductionProxyNetworkDelegate::MaybeAddChromeProxyECTHeader(
const net::URLRequest& request) const {
DCHECK(thread_checker_.CalledOnValidThread());
+ if (!data_reduction_proxy::features::IsDataReductionProxyECTHeaderEnabled())
+ return;
+
// This method should be called only when the resolved proxy was a data
// saver proxy.
DCHECK(request.url().is_valid());
@@ -562,6 +568,9 @@ void DataReductionProxyNetworkDelegate::RemoveChromeProxyECTHeader(
net::HttpRequestHeaders* request_headers) const {
DCHECK(thread_checker_.CalledOnValidThread());
+ if (!data_reduction_proxy::features::IsDataReductionProxyECTHeaderEnabled())
+ return;
+
request_headers->RemoveHeader(chrome_proxy_ect_header());
}
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698