OLD | NEW |
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 NET_BASE_LAYERED_NETWORK_DELEGATE_H_ | 5 #ifndef NET_BASE_LAYERED_NETWORK_DELEGATE_H_ |
6 #define NET_BASE_LAYERED_NETWORK_DELEGATE_H_ | 6 #define NET_BASE_LAYERED_NETWORK_DELEGATE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 // return values, and cannot prevent calling into the nested network delegate. | 33 // return values, and cannot prevent calling into the nested network delegate. |
34 class NET_EXPORT LayeredNetworkDelegate : public NetworkDelegate { | 34 class NET_EXPORT LayeredNetworkDelegate : public NetworkDelegate { |
35 public: | 35 public: |
36 explicit LayeredNetworkDelegate( | 36 explicit LayeredNetworkDelegate( |
37 scoped_ptr<NetworkDelegate> nested_network_delegate); | 37 scoped_ptr<NetworkDelegate> nested_network_delegate); |
38 ~LayeredNetworkDelegate() override; | 38 ~LayeredNetworkDelegate() override; |
39 | 39 |
40 // NetworkDelegate implementation: | 40 // NetworkDelegate implementation: |
41 int OnBeforeURLRequest(URLRequest* request, | 41 int OnBeforeURLRequest(URLRequest* request, |
42 const CompletionCallback& callback, | 42 const CompletionCallback& callback, |
43 GURL* new_url) final override; | 43 GURL* new_url) final; |
44 void OnResolveProxy(const GURL& url, | 44 void OnResolveProxy(const GURL& url, |
45 int load_flags, | 45 int load_flags, |
46 const ProxyService& proxy_service, | 46 const ProxyService& proxy_service, |
47 ProxyInfo* result) final override; | 47 ProxyInfo* result) final; |
48 void OnProxyFallback(const ProxyServer& bad_proxy, | 48 void OnProxyFallback(const ProxyServer& bad_proxy, int net_error) final; |
49 int net_error) final override; | |
50 int OnBeforeSendHeaders(URLRequest* request, | 49 int OnBeforeSendHeaders(URLRequest* request, |
51 const CompletionCallback& callback, | 50 const CompletionCallback& callback, |
52 HttpRequestHeaders* headers) final override; | 51 HttpRequestHeaders* headers) final; |
53 void OnBeforeSendProxyHeaders(URLRequest* request, | 52 void OnBeforeSendProxyHeaders(URLRequest* request, |
54 const ProxyInfo& proxy_info, | 53 const ProxyInfo& proxy_info, |
55 HttpRequestHeaders* headers) final override; | 54 HttpRequestHeaders* headers) final; |
56 void OnSendHeaders(URLRequest* request, | 55 void OnSendHeaders(URLRequest* request, |
57 const HttpRequestHeaders& headers) final override; | 56 const HttpRequestHeaders& headers) final; |
58 int OnHeadersReceived( | 57 int OnHeadersReceived( |
59 URLRequest* request, | 58 URLRequest* request, |
60 const CompletionCallback& callback, | 59 const CompletionCallback& callback, |
61 const HttpResponseHeaders* original_response_headers, | 60 const HttpResponseHeaders* original_response_headers, |
62 scoped_refptr<HttpResponseHeaders>* override_response_headers, | 61 scoped_refptr<HttpResponseHeaders>* override_response_headers, |
63 GURL* allowed_unsafe_redirect_url) final override; | 62 GURL* allowed_unsafe_redirect_url) final; |
64 void OnBeforeRedirect(URLRequest* request, | 63 void OnBeforeRedirect(URLRequest* request, const GURL& new_location) final; |
65 const GURL& new_location) final override; | 64 void OnResponseStarted(URLRequest* request) final; |
66 void OnResponseStarted(URLRequest* request) final override; | 65 void OnRawBytesRead(const URLRequest& request, int bytes_read) final; |
67 void OnRawBytesRead(const URLRequest& request, int bytes_read) final override; | 66 void OnCompleted(URLRequest* request, bool started) final; |
68 void OnCompleted(URLRequest* request, bool started) final override; | 67 void OnURLRequestDestroyed(URLRequest* request) final; |
69 void OnURLRequestDestroyed(URLRequest* request) final override; | 68 void OnPACScriptError(int line_number, const base::string16& error) final; |
70 void OnPACScriptError(int line_number, | 69 AuthRequiredResponse OnAuthRequired(URLRequest* request, |
71 const base::string16& error) final override; | 70 const AuthChallengeInfo& auth_info, |
72 AuthRequiredResponse OnAuthRequired( | 71 const AuthCallback& callback, |
73 URLRequest* request, | 72 AuthCredentials* credentials) final; |
74 const AuthChallengeInfo& auth_info, | |
75 const AuthCallback& callback, | |
76 AuthCredentials* credentials) final override; | |
77 bool OnCanGetCookies(const URLRequest& request, | 73 bool OnCanGetCookies(const URLRequest& request, |
78 const CookieList& cookie_list) final override; | 74 const CookieList& cookie_list) final; |
79 bool OnCanSetCookie(const URLRequest& request, | 75 bool OnCanSetCookie(const URLRequest& request, |
80 const std::string& cookie_line, | 76 const std::string& cookie_line, |
81 CookieOptions* options) final override; | 77 CookieOptions* options) final; |
82 bool OnCanAccessFile(const URLRequest& request, | 78 bool OnCanAccessFile(const URLRequest& request, |
83 const base::FilePath& path) const final override; | 79 const base::FilePath& path) const final; |
84 bool OnCanThrottleRequest(const URLRequest& request) const final override; | 80 bool OnCanThrottleRequest(const URLRequest& request) const final; |
85 bool OnCanEnablePrivacyMode( | 81 bool OnCanEnablePrivacyMode(const GURL& url, |
86 const GURL& url, | 82 const GURL& first_party_for_cookies) const final; |
87 const GURL& first_party_for_cookies) const final override; | |
88 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 83 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
89 const URLRequest& request, | 84 const URLRequest& request, |
90 const GURL& target_url, | 85 const GURL& target_url, |
91 const GURL& referrer_url) const final override; | 86 const GURL& referrer_url) const final; |
92 | 87 |
93 protected: | 88 protected: |
94 virtual void OnBeforeURLRequestInternal(URLRequest* request, | 89 virtual void OnBeforeURLRequestInternal(URLRequest* request, |
95 const CompletionCallback& callback, | 90 const CompletionCallback& callback, |
96 GURL* new_url); | 91 GURL* new_url); |
97 | 92 |
98 virtual void OnResolveProxyInternal(const GURL& url, | 93 virtual void OnResolveProxyInternal(const GURL& url, |
99 int load_flags, | 94 int load_flags, |
100 const ProxyService& proxy_service, | 95 const ProxyService& proxy_service, |
101 ProxyInfo* result); | 96 ProxyInfo* result); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 const GURL& target_url, | 157 const GURL& target_url, |
163 const GURL& referrer_url) const; | 158 const GURL& referrer_url) const; |
164 | 159 |
165 private: | 160 private: |
166 scoped_ptr<NetworkDelegate> nested_network_delegate_; | 161 scoped_ptr<NetworkDelegate> nested_network_delegate_; |
167 }; | 162 }; |
168 | 163 |
169 } // namespace net | 164 } // namespace net |
170 | 165 |
171 #endif // NET_BASE_LAYERED_NETWORK_DELEGATE_H_ | 166 #endif // NET_BASE_LAYERED_NETWORK_DELEGATE_H_ |
OLD | NEW |