| OLD | NEW |
| 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_impl.h" | 9 #include "net/base/network_delegate_impl.h" |
| 10 | 10 |
| 11 namespace net { | 11 namespace net { |
| 12 class ProxyInfo; | 12 class ProxyInfo; |
| 13 class URLRequest; | 13 class URLRequest; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace android_webview { | 16 namespace android_webview { |
| 17 | 17 |
| 18 // WebView's implementation of the NetworkDelegate. | 18 // WebView's implementation of the NetworkDelegate. |
| 19 class AwNetworkDelegate : public net::NetworkDelegateImpl { | 19 class AwNetworkDelegate : public net::NetworkDelegateImpl { |
| 20 public: | 20 public: |
| 21 AwNetworkDelegate(); | 21 AwNetworkDelegate(); |
| 22 virtual ~AwNetworkDelegate(); | 22 ~AwNetworkDelegate() override; |
| 23 | 23 |
| 24 private: | 24 private: |
| 25 // NetworkDelegate implementation. | 25 // NetworkDelegate implementation. |
| 26 virtual int OnBeforeURLRequest(net::URLRequest* request, | 26 int OnBeforeURLRequest(net::URLRequest* request, |
| 27 const net::CompletionCallback& callback, | 27 const net::CompletionCallback& callback, |
| 28 GURL* new_url) override; | 28 GURL* new_url) override; |
| 29 virtual int OnBeforeSendHeaders(net::URLRequest* request, | 29 int OnBeforeSendHeaders(net::URLRequest* request, |
| 30 const net::CompletionCallback& callback, | 30 const net::CompletionCallback& callback, |
| 31 net::HttpRequestHeaders* headers) override; | 31 net::HttpRequestHeaders* headers) override; |
| 32 virtual void OnSendHeaders(net::URLRequest* request, | 32 void OnSendHeaders(net::URLRequest* request, |
| 33 const net::HttpRequestHeaders& headers) override; | 33 const net::HttpRequestHeaders& headers) override; |
| 34 virtual int OnHeadersReceived( | 34 int OnHeadersReceived( |
| 35 net::URLRequest* request, | 35 net::URLRequest* request, |
| 36 const net::CompletionCallback& callback, | 36 const net::CompletionCallback& callback, |
| 37 const net::HttpResponseHeaders* original_response_headers, | 37 const net::HttpResponseHeaders* original_response_headers, |
| 38 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, | 38 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, |
| 39 GURL* allowed_unsafe_redirect_url) override; | 39 GURL* allowed_unsafe_redirect_url) override; |
| 40 virtual void OnBeforeRedirect(net::URLRequest* request, | 40 void OnBeforeRedirect(net::URLRequest* request, |
| 41 const GURL& new_location) override; | 41 const GURL& new_location) override; |
| 42 virtual void OnResponseStarted(net::URLRequest* request) override; | 42 void OnResponseStarted(net::URLRequest* request) override; |
| 43 virtual void OnRawBytesRead(const net::URLRequest& request, | 43 void OnRawBytesRead(const net::URLRequest& request, int bytes_read) override; |
| 44 int bytes_read) override; | 44 void OnCompleted(net::URLRequest* request, bool started) override; |
| 45 virtual void OnCompleted(net::URLRequest* request, bool started) override; | 45 void OnURLRequestDestroyed(net::URLRequest* request) override; |
| 46 virtual void OnURLRequestDestroyed(net::URLRequest* request) override; | 46 void OnPACScriptError(int line_number, const base::string16& error) override; |
| 47 virtual void OnPACScriptError(int line_number, | 47 net::NetworkDelegate::AuthRequiredResponse OnAuthRequired( |
| 48 const base::string16& error) override; | |
| 49 virtual net::NetworkDelegate::AuthRequiredResponse OnAuthRequired( | |
| 50 net::URLRequest* request, | 48 net::URLRequest* request, |
| 51 const net::AuthChallengeInfo& auth_info, | 49 const net::AuthChallengeInfo& auth_info, |
| 52 const AuthCallback& callback, | 50 const AuthCallback& callback, |
| 53 net::AuthCredentials* credentials) override; | 51 net::AuthCredentials* credentials) override; |
| 54 virtual bool OnCanGetCookies(const net::URLRequest& request, | 52 bool OnCanGetCookies(const net::URLRequest& request, |
| 55 const net::CookieList& cookie_list) override; | 53 const net::CookieList& cookie_list) override; |
| 56 virtual bool OnCanSetCookie(const net::URLRequest& request, | 54 bool OnCanSetCookie(const net::URLRequest& request, |
| 57 const std::string& cookie_line, | 55 const std::string& cookie_line, |
| 58 net::CookieOptions* options) override; | 56 net::CookieOptions* options) override; |
| 59 virtual bool OnCanAccessFile(const net::URLRequest& request, | 57 bool OnCanAccessFile(const net::URLRequest& request, |
| 60 const base::FilePath& path) const override; | 58 const base::FilePath& path) const override; |
| 61 virtual bool OnCanThrottleRequest( | 59 bool OnCanThrottleRequest(const net::URLRequest& request) const override; |
| 62 const net::URLRequest& request) const override; | |
| 63 | 60 |
| 64 DISALLOW_COPY_AND_ASSIGN(AwNetworkDelegate); | 61 DISALLOW_COPY_AND_ASSIGN(AwNetworkDelegate); |
| 65 }; | 62 }; |
| 66 | 63 |
| 67 } // namespace android_webview | 64 } // namespace android_webview |
| 68 | 65 |
| 69 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_NETWORK_DELEGATE_H_ | 66 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_NETWORK_DELEGATE_H_ |
| OLD | NEW |