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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_protocol.h

Issue 449973002: Use data reduction proxy when managed proxy config returns direct (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-uma-in-proxy-service
Patch Set: Addressed comment and nit Created 6 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PROTOCOL_H_ 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PROTOCOL_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PROTOCOL_H_ 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PROTOCOL_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "components/data_reduction_proxy/common/data_reduction_proxy_headers.h" 9 #include "components/data_reduction_proxy/common/data_reduction_proxy_headers.h"
10 #include "net/proxy/proxy_retry_info.h"
10 11
11 namespace base { 12 namespace base {
12 class TimeDelta; 13 class TimeDelta;
13 } 14 }
14 15
15 namespace net { 16 namespace net {
16 class HttpResponseHeaders; 17 class HttpResponseHeaders;
18 class ProxyConfig;
17 class ProxyInfo; 19 class ProxyInfo;
18 class ProxyServer; 20 class ProxyServer;
19 class URLRequest; 21 class URLRequest;
20 } 22 }
21 23
22 class GURL; 24 class GURL;
23 25
24 namespace data_reduction_proxy { 26 namespace data_reduction_proxy {
25 27
26 class DataReductionProxyParams; 28 class DataReductionProxyParams;
(...skipping 10 matching lines...) Expand all
37 DataReductionProxyBypassType* proxy_bypass_type); 39 DataReductionProxyBypassType* proxy_bypass_type);
38 40
39 // Configure |result| to proceed directly to the origin if |result|'s current 41 // Configure |result| to proceed directly to the origin if |result|'s current
40 // proxy is the data reduction proxy, the 42 // proxy is the data reduction proxy, the
41 // |net::LOAD_BYPASS_DATA_REDUCTION_PROXY| |load_flag| is set, and the 43 // |net::LOAD_BYPASS_DATA_REDUCTION_PROXY| |load_flag| is set, and the
42 // DataCompressionProxyCriticalBypass Finch trial is set. 44 // DataCompressionProxyCriticalBypass Finch trial is set.
43 // This handler is intended to be invoked only by 45 // This handler is intended to be invoked only by
44 // |ChromeNetworkDelegate.NotifyResolveProxy|. 46 // |ChromeNetworkDelegate.NotifyResolveProxy|.
45 void OnResolveProxyHandler(const GURL& url, 47 void OnResolveProxyHandler(const GURL& url,
46 int load_flags, 48 int load_flags,
49 const net::ProxyConfig& data_reduction_proxy_config,
50 const net::ProxyRetryInfoMap& proxy_retry_info,
47 const DataReductionProxyParams* params, 51 const DataReductionProxyParams* params,
48 net::ProxyInfo* result); 52 net::ProxyInfo* result);
49 53
50 // Returns true if the request method is idempotent. Only idempotent requests 54 // Returns true if the request method is idempotent. Only idempotent requests
51 // are retried on a bypass. Visible as part of the public API for testing. 55 // are retried on a bypass. Visible as part of the public API for testing.
52 bool IsRequestIdempotent(const net::URLRequest* request); 56 bool IsRequestIdempotent(const net::URLRequest* request);
53 57
54 // Sets the override headers to contain a status line that indicates a 58 // Sets the override headers to contain a status line that indicates a
55 // redirect (a 302), a "Location:" header that points to the request url, 59 // redirect (a 302), a "Location:" header that points to the request url,
56 // and sets load flags to bypass proxies. 60 // and sets load flags to bypass proxies.
57 // Visible as part of the public API for testing. 61 // Visible as part of the public API for testing.
58 void OverrideResponseAsRedirect( 62 void OverrideResponseAsRedirect(
59 net::URLRequest* request, 63 net::URLRequest* request,
60 const net::HttpResponseHeaders* original_response_headers, 64 const net::HttpResponseHeaders* original_response_headers,
61 scoped_refptr<net::HttpResponseHeaders>* override_response_headers); 65 scoped_refptr<net::HttpResponseHeaders>* override_response_headers);
62 66
63 // Adds non-empty entries in |data_reduction_proxies| to the retry map 67 // Adds non-empty entries in |data_reduction_proxies| to the retry map
64 // maintained by the proxy service of the request. Adds 68 // maintained by the proxy service of the request. Adds
65 // |data_reduction_proxies.second| to the retry list only if |bypass_all| is 69 // |data_reduction_proxies.second| to the retry list only if |bypass_all| is
66 // true. Visible as part of the public API for testing. 70 // true. Visible as part of the public API for testing.
67 void MarkProxiesAsBadUntil(net::URLRequest* request, 71 void MarkProxiesAsBadUntil(net::URLRequest* request,
68 base::TimeDelta& bypass_duration, 72 base::TimeDelta& bypass_duration,
69 bool bypass_all, 73 bool bypass_all,
70 const std::pair<GURL, GURL>& data_reduction_proxies); 74 const std::pair<GURL, GURL>& data_reduction_proxies);
71 75
72 } // namespace data_reduction_proxy 76 } // namespace data_reduction_proxy
73 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PROTOCOL _H_ 77 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PROTOCOL _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698