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

Side by Side Diff: android_webview/browser/net/aw_network_delegate.h

Issue 734263003: Move data reduction proxy logic out of chrome and android webview network delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test fix Created 6 years 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
« no previous file with comments | « no previous file | android_webview/browser/net/aw_network_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 ANDROID_WEBVIEW_BROWSER_NET_AW_NETWORK_DELEGATE_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_NET_AW_NETWORK_DELEGATE_H_
6 #define ANDROID_WEBVIEW_BROWSER_NET_AW_NETWORK_DELEGATE_H_ 6 #define ANDROID_WEBVIEW_BROWSER_NET_AW_NETWORK_DELEGATE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "net/base/network_delegate.h" 9 #include "net/base/network_delegate_impl.h"
10
11 namespace data_reduction_proxy {
12 class DataReductionProxyAuthRequestHandler;
13 class DataReductionProxyParams;
14 }
15 10
16 namespace net { 11 namespace net {
17 class ProxyInfo; 12 class ProxyInfo;
18 class URLRequest; 13 class URLRequest;
19 } 14 }
20 15
21 namespace android_webview { 16 namespace android_webview {
22 17
23 // WebView's implementation of the NetworkDelegate. 18 // WebView's implementation of the NetworkDelegate.
24 class AwNetworkDelegate : public net::NetworkDelegate { 19 class AwNetworkDelegate : public net::NetworkDelegateImpl {
25 public: 20 public:
26 AwNetworkDelegate(); 21 AwNetworkDelegate();
27 virtual ~AwNetworkDelegate(); 22 virtual ~AwNetworkDelegate();
28 23
29 // Sets the |DataReductionProxySettings| object to use. If not set, the
30 // NetworkDelegate will not perform any operations related to the data
31 // reduction proxy.
32 void set_data_reduction_proxy_params(
33 data_reduction_proxy::DataReductionProxyParams* params) {
34 data_reduction_proxy_params_ = params;
35 }
36
37 void set_data_reduction_proxy_auth_request_handler(
38 data_reduction_proxy::DataReductionProxyAuthRequestHandler* handler) {
39 data_reduction_proxy_auth_request_handler_ = handler;
40 }
41
42 private: 24 private:
43 // NetworkDelegate implementation. 25 // NetworkDelegate implementation.
44 virtual int OnBeforeURLRequest(net::URLRequest* request, 26 virtual int OnBeforeURLRequest(net::URLRequest* request,
45 const net::CompletionCallback& callback, 27 const net::CompletionCallback& callback,
46 GURL* new_url) override; 28 GURL* new_url) override;
47 virtual int OnBeforeSendHeaders(net::URLRequest* request, 29 virtual int OnBeforeSendHeaders(net::URLRequest* request,
48 const net::CompletionCallback& callback, 30 const net::CompletionCallback& callback,
49 net::HttpRequestHeaders* headers) override; 31 net::HttpRequestHeaders* headers) override;
50 virtual void OnBeforeSendProxyHeaders(
51 net::URLRequest* request,
52 const net::ProxyInfo& proxy_info,
53 net::HttpRequestHeaders* headers) override;
54 virtual void OnSendHeaders(net::URLRequest* request, 32 virtual void OnSendHeaders(net::URLRequest* request,
55 const net::HttpRequestHeaders& headers) override; 33 const net::HttpRequestHeaders& headers) override;
56 virtual int OnHeadersReceived( 34 virtual int OnHeadersReceived(
57 net::URLRequest* request, 35 net::URLRequest* request,
58 const net::CompletionCallback& callback, 36 const net::CompletionCallback& callback,
59 const net::HttpResponseHeaders* original_response_headers, 37 const net::HttpResponseHeaders* original_response_headers,
60 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, 38 scoped_refptr<net::HttpResponseHeaders>* override_response_headers,
61 GURL* allowed_unsafe_redirect_url) override; 39 GURL* allowed_unsafe_redirect_url) override;
62 virtual void OnBeforeRedirect(net::URLRequest* request, 40 virtual void OnBeforeRedirect(net::URLRequest* request,
63 const GURL& new_location) override; 41 const GURL& new_location) override;
(...skipping 12 matching lines...) Expand all
76 virtual bool OnCanGetCookies(const net::URLRequest& request, 54 virtual bool OnCanGetCookies(const net::URLRequest& request,
77 const net::CookieList& cookie_list) override; 55 const net::CookieList& cookie_list) override;
78 virtual bool OnCanSetCookie(const net::URLRequest& request, 56 virtual bool OnCanSetCookie(const net::URLRequest& request,
79 const std::string& cookie_line, 57 const std::string& cookie_line,
80 net::CookieOptions* options) override; 58 net::CookieOptions* options) override;
81 virtual bool OnCanAccessFile(const net::URLRequest& request, 59 virtual bool OnCanAccessFile(const net::URLRequest& request,
82 const base::FilePath& path) const override; 60 const base::FilePath& path) const override;
83 virtual bool OnCanThrottleRequest( 61 virtual bool OnCanThrottleRequest(
84 const net::URLRequest& request) const override; 62 const net::URLRequest& request) const override;
85 63
86 // Data reduction proxy parameters object. Must outlive this.
87 data_reduction_proxy::DataReductionProxyParams* data_reduction_proxy_params_;
88 data_reduction_proxy::DataReductionProxyAuthRequestHandler*
89 data_reduction_proxy_auth_request_handler_;
90
91 DISALLOW_COPY_AND_ASSIGN(AwNetworkDelegate); 64 DISALLOW_COPY_AND_ASSIGN(AwNetworkDelegate);
92 }; 65 };
93 66
94 } // namespace android_webview 67 } // namespace android_webview
95 68
96 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_NETWORK_DELEGATE_H_ 69 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_NETWORK_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/net/aw_network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698