Index: components/data_reduction_proxy/browser/data_reduction_proxy_params.cc |
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc |
index 1dfbaaa89ada462b7362394994b18db2a6effe55..a830d7b8f8b0e4296ebc29f49b13b3be326e6177 100644 |
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc |
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc |
@@ -12,6 +12,7 @@ |
#include "base/time/time.h" |
#include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h" |
#include "net/base/host_port_pair.h" |
+#include "net/proxy/proxy_config.h" |
#include "net/proxy/proxy_info.h" |
#include "net/proxy/proxy_retry_info.h" |
#include "net/proxy/proxy_server.h" |
@@ -366,6 +367,21 @@ bool DataReductionProxyParams::IsDataReductionProxyEligible( |
return IsDataReductionProxy(result.proxy_server().host_port_pair(), NULL); |
} |
+bool DataReductionProxyParams::PassesDataReductionProxyLocalBypassRules( |
bengr
2014/08/29 19:29:48
Maybe rename as IsBypassedByDataReductionProxyLoca
megjablon
2014/08/29 20:26:32
Ya, I like that better
|
+ const net::URLRequest& request, |
+ const net::ProxyConfig& data_reduction_proxy_config) { |
bengr
2014/08/29 19:29:48
It looks like this function can be const.
megjablon
2014/08/29 20:26:32
Done.
|
+ DCHECK(request.context()); |
+ DCHECK(request.context()->proxy_service()); |
+ net::ProxyInfo result; |
+ data_reduction_proxy_config.proxy_rules().Apply( |
+ request.url(), &result); |
+ if (!result.proxy_server().is_valid()) |
+ return false; |
+ if (result.proxy_server().is_direct()) |
+ return false; |
+ return IsDataReductionProxy(result.proxy_server().host_port_pair(), NULL); |
+} |
+ |
std::string DataReductionProxyParams::GetDefaultDevOrigin() const { |
#if defined(DATA_REDUCTION_DEV_HOST) |
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |