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

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

Issue 958163004: Make Data Saver proxy bypass logic apply to redirects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Suppress size_t to int warnings in gyp/gn files (crbug 167187) Created 5 years, 10 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.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.h
index f78c11e4c0bfaf6c4bb704cdf1ace2604e528708..0e248146a6a0ed383a997ed237d2c59b41387a13 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.h
@@ -15,7 +15,7 @@ class DataReductionProxyEventStore;
class DataReductionProxyUsageStats;
// Used to intercept responses that contain explicit and implicit signals
-// to bypass the data reduction proxy. If the proxy should be bypassed,
+// to bypass the Data Reduction Proxy. If the proxy should be bypassed,
// the interceptor returns a new URLRequestHTTPJob that fetches the resource
// without use of the proxy.
class DataReductionProxyInterceptor : public net::URLRequestInterceptor {
@@ -34,15 +34,28 @@ class DataReductionProxyInterceptor : public net::URLRequestInterceptor {
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const override;
- // Returns a new URLRequestHTTPJob if the response indicates that the data
- // reduction proxy should be bypassed according to the rules in |protocol_|.
- // Returns NULL otherwise. If a job is returned, the interceptor's
- // URLRequestInterceptingJobFactory will restart the request.
+ // Returns a new URLRequestHTTPJob if the redirect indicates that the Data
+ // Reduction Proxy should be bypassed. See |MaybeInterceptResponseOrRedirect|
+ // for more details.
+ net::URLRequestJob* MaybeInterceptRedirect(
+ net::URLRequest* request, net::NetworkDelegate* network_delegate,
+ const GURL& location) const override;
+
+ // Returns a new URLRequestHTTPJob if the response indicates that the Data
+ // Reduction Proxy should be bypassed. See |MaybeInterceptResponseOrRedirect|
+ // for more details.
net::URLRequestJob* MaybeInterceptResponse(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const override;
private:
+ // Returns a new URLRequestHTTPJob if the response or redirect indicates that
+ // the data reduction proxy should be bypassed according to the rules in
+ // |bypass_protocol_|. Returns NULL otherwise. If a job is returned, the
+ // interceptor's URLRequestInterceptingJobFactory will restart the request.
+ net::URLRequestJob* MaybeInterceptResponseOrRedirect(
+ net::URLRequest* request, net::NetworkDelegate* network_delegate) const;
+
// Must outlive |this| if non-NULL.
DataReductionProxyUsageStats* usage_stats_;

Powered by Google App Engine
This is Rietveld 408576698