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

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

Issue 836583002: Add support for field trial group to relax missing via header bypass logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unused include from aw_url_request_context_getter.cc Created 5 years, 11 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
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.cc
index 36373a21e1fbb97f78b8370ef17c21c72760d690..028316337aa79755f825a8c6db589f105c283473 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.cc
@@ -4,7 +4,7 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.h"
-#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_protocol.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats.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"
@@ -23,8 +23,9 @@ DataReductionProxyInterceptor::DataReductionProxyInterceptor(
DataReductionProxyEventStore* event_store)
: params_(params),
usage_stats_(stats),
- event_store_(event_store) {
-}
+ event_store_(event_store),
+ bypass_protocol_(
+ new DataReductionProxyBypassProtocol(params, event_store)) {}
DataReductionProxyInterceptor::~DataReductionProxyInterceptor() {
}
@@ -41,8 +42,8 @@ net::URLRequestJob* DataReductionProxyInterceptor::MaybeInterceptResponse(
if (request->response_info().was_cached)
return nullptr;
DataReductionProxyBypassType bypass_type = BYPASS_EVENT_TYPE_MAX;
- bool should_retry = data_reduction_proxy::MaybeBypassProxyAndPrepareToRetry(
- params_, request, &bypass_type, event_store_);
+ bool should_retry = bypass_protocol_->MaybeBypassProxyAndPrepareToRetry(
+ request, &bypass_type);
if (usage_stats_ && bypass_type != BYPASS_EVENT_TYPE_MAX)
usage_stats_->SetBypassType(bypass_type);
if (!should_retry)

Powered by Google App Engine
This is Rietveld 408576698