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 CHROME_BROWSER_NET_CHROME_EXTENSIONS_NETWORK_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_EXTENSIONS_NETWORK_DELEGATE_H_ |
6 #define CHROME_BROWSER_NET_CHROME_EXTENSIONS_NETWORK_DELEGATE_H_ | 6 #define CHROME_BROWSER_NET_CHROME_EXTENSIONS_NETWORK_DELEGATE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 void set_extension_info_map(extensions::InfoMap* extension_info_map); | 29 void set_extension_info_map(extensions::InfoMap* extension_info_map); |
30 | 30 |
31 // If |profile| is NULL or not set, events will be broadcast to all profiles, | 31 // If |profile| is NULL or not set, events will be broadcast to all profiles, |
32 // otherwise they will only be sent to the specified profile. | 32 // otherwise they will only be sent to the specified profile. |
33 void set_profile(void* profile) { | 33 void set_profile(void* profile) { |
34 profile_ = profile; | 34 profile_ = profile; |
35 } | 35 } |
36 | 36 |
37 // If the |request| failed due to problems with a proxy, forward the error to | 37 // If the |request| failed due to problems with a proxy, forward the error to |
38 // the proxy extension API. | 38 // the proxy extension API. |
39 virtual void ForwardProxyErrors(net::URLRequest* request); | 39 virtual void ForwardProxyErrors(net::URLRequest* request, int net_error); |
40 | 40 |
41 // Notifies the extensions::ProcessManager for the associated RenderFrame, if | 41 // Notifies the extensions::ProcessManager for the associated RenderFrame, if |
42 // any, that a request has started or stopped. | 42 // any, that a request has started or stopped. |
43 virtual void ForwardStartRequestStatus(net::URLRequest* request); | 43 virtual void ForwardStartRequestStatus(net::URLRequest* request); |
44 virtual void ForwardDoneRequestStatus(net::URLRequest* request); | 44 virtual void ForwardDoneRequestStatus(net::URLRequest* request); |
45 | 45 |
46 // NetworkDelegate implementation. | 46 // NetworkDelegate implementation. |
47 int OnBeforeURLRequest(net::URLRequest* request, | 47 int OnBeforeURLRequest(net::URLRequest* request, |
48 const net::CompletionCallback& callback, | 48 const net::CompletionCallback& callback, |
49 GURL* new_url) override; | 49 GURL* new_url) override; |
50 int OnBeforeStartTransaction(net::URLRequest* request, | 50 int OnBeforeStartTransaction(net::URLRequest* request, |
51 const net::CompletionCallback& callback, | 51 const net::CompletionCallback& callback, |
52 net::HttpRequestHeaders* headers) override; | 52 net::HttpRequestHeaders* headers) override; |
53 void OnStartTransaction(net::URLRequest* request, | 53 void OnStartTransaction(net::URLRequest* request, |
54 const net::HttpRequestHeaders& headers) override; | 54 const net::HttpRequestHeaders& headers) override; |
55 int OnHeadersReceived( | 55 int OnHeadersReceived( |
56 net::URLRequest* request, | 56 net::URLRequest* request, |
57 const net::CompletionCallback& callback, | 57 const net::CompletionCallback& callback, |
58 const net::HttpResponseHeaders* original_response_headers, | 58 const net::HttpResponseHeaders* original_response_headers, |
59 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, | 59 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, |
60 GURL* allowed_unsafe_redirect_url) override; | 60 GURL* allowed_unsafe_redirect_url) override; |
61 void OnBeforeRedirect(net::URLRequest* request, | 61 void OnBeforeRedirect(net::URLRequest* request, |
62 const GURL& new_location) override; | 62 const GURL& new_location) override; |
63 void OnResponseStarted(net::URLRequest* request) override; | 63 void OnResponseStarted(net::URLRequest* request, int net_error) override; |
64 void OnCompleted(net::URLRequest* request, bool started) override; | 64 void OnCompleted(net::URLRequest* request, |
| 65 bool started, |
| 66 int net_error) override; |
65 void OnURLRequestDestroyed(net::URLRequest* request) override; | 67 void OnURLRequestDestroyed(net::URLRequest* request) override; |
66 void OnPACScriptError(int line_number, const base::string16& error) override; | 68 void OnPACScriptError(int line_number, const base::string16& error) override; |
67 net::NetworkDelegate::AuthRequiredResponse OnAuthRequired( | 69 net::NetworkDelegate::AuthRequiredResponse OnAuthRequired( |
68 net::URLRequest* request, | 70 net::URLRequest* request, |
69 const net::AuthChallengeInfo& auth_info, | 71 const net::AuthChallengeInfo& auth_info, |
70 const AuthCallback& callback, | 72 const AuthCallback& callback, |
71 net::AuthCredentials* credentials) override; | 73 net::AuthCredentials* credentials) override; |
72 | 74 |
73 protected: | 75 protected: |
74 ChromeExtensionsNetworkDelegate(); | 76 ChromeExtensionsNetworkDelegate(); |
75 | 77 |
76 void* profile_; | 78 void* profile_; |
77 | 79 |
78 #if defined(ENABLE_EXTENSIONS) | 80 #if defined(ENABLE_EXTENSIONS) |
79 scoped_refptr<extensions::InfoMap> extension_info_map_; | 81 scoped_refptr<extensions::InfoMap> extension_info_map_; |
80 #endif | 82 #endif |
81 | 83 |
82 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsNetworkDelegate); | 84 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsNetworkDelegate); |
83 }; | 85 }; |
84 | 86 |
85 #endif // CHROME_BROWSER_NET_CHROME_EXTENSIONS_NETWORK_DELEGATE_H_ | 87 #endif // CHROME_BROWSER_NET_CHROME_EXTENSIONS_NETWORK_DELEGATE_H_ |
OLD | NEW |