| Index: components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc
|
| diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc
|
| index 53ece226733e4c12637891abcdb7f1691d877e6b..40461a262349dc47c26cffa953d2a92d61fa38df 100644
|
| --- a/components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc
|
| +++ b/components/data_reduction_proxy/browser/data_reduction_proxy_protocol.cc
|
| @@ -17,6 +17,8 @@
|
| #include "net/url_request/url_request.h"
|
| #include "net/url_request/url_request_context.h"
|
| #include "url/gurl.h"
|
| +#include "webkit/common/resource_type.h"
|
| +
|
|
|
| namespace {
|
| bool SetProxyServerFromGURL(const GURL& gurl,
|
| @@ -85,7 +87,22 @@ bool MaybeBypassProxyAndPrepareToRetry(
|
| return true;
|
| }
|
|
|
| +int BuildLoadFlagsForRequest(ResourceType::Type resource_type) {
|
| + int flags = 0;
|
| + if (DataReductionProxyParams::IsIncludedInCriticalPathBypassFieldTrial() &&
|
| + resource_type != ResourceType::IMAGE)
|
| + flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY;
|
| + return flags;
|
| +}
|
|
|
| +void OnResolveProxyHandler(const GURL& url, int load_flags,
|
| + net::ProxyInfo* result) {
|
| + if ((load_flags & net::LOAD_BYPASS_DATA_REDUCTION_PROXY) &&
|
| + !result->is_direct() &&
|
| + result->proxy_server().isDataReductionProxy()) {
|
| + result->UseDirect();
|
| + }
|
| +}
|
|
|
| bool IsRequestIdempotent(const net::URLRequest* request) {
|
| DCHECK(request);
|
|
|