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 NET_BASE_NETWORK_DELEGATE_H_ | 5 #ifndef NET_BASE_NETWORK_DELEGATE_H_ |
6 #define NET_BASE_NETWORK_DELEGATE_H_ | 6 #define NET_BASE_NETWORK_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 GURL* new_url); | 62 GURL* new_url); |
63 int NotifyBeforeSendHeaders(URLRequest* request, | 63 int NotifyBeforeSendHeaders(URLRequest* request, |
64 const CompletionCallback& callback, | 64 const CompletionCallback& callback, |
65 HttpRequestHeaders* headers); | 65 HttpRequestHeaders* headers); |
66 void NotifySendHeaders(URLRequest* request, | 66 void NotifySendHeaders(URLRequest* request, |
67 const HttpRequestHeaders& headers); | 67 const HttpRequestHeaders& headers); |
68 int NotifyHeadersReceived( | 68 int NotifyHeadersReceived( |
69 URLRequest* request, | 69 URLRequest* request, |
70 const CompletionCallback& callback, | 70 const CompletionCallback& callback, |
71 const HttpResponseHeaders* original_response_headers, | 71 const HttpResponseHeaders* original_response_headers, |
72 scoped_refptr<HttpResponseHeaders>* override_response_headers); | 72 scoped_refptr<HttpResponseHeaders>* override_response_headers, |
| 73 GURL* allowed_unsafe_redirect_url); |
73 void NotifyBeforeRedirect(URLRequest* request, | 74 void NotifyBeforeRedirect(URLRequest* request, |
74 const GURL& new_location); | 75 const GURL& new_location); |
75 void NotifyResponseStarted(URLRequest* request); | 76 void NotifyResponseStarted(URLRequest* request); |
76 void NotifyRawBytesRead(const URLRequest& request, int bytes_read); | 77 void NotifyRawBytesRead(const URLRequest& request, int bytes_read); |
77 void NotifyCompleted(URLRequest* request, bool started); | 78 void NotifyCompleted(URLRequest* request, bool started); |
78 void NotifyURLRequestDestroyed(URLRequest* request); | 79 void NotifyURLRequestDestroyed(URLRequest* request); |
79 void NotifyPACScriptError(int line_number, const base::string16& error); | 80 void NotifyPACScriptError(int line_number, const base::string16& error); |
80 AuthRequiredResponse NotifyAuthRequired(URLRequest* request, | 81 AuthRequiredResponse NotifyAuthRequired(URLRequest* request, |
81 const AuthChallengeInfo& auth_info, | 82 const AuthChallengeInfo& auth_info, |
82 const AuthCallback& callback, | 83 const AuthCallback& callback, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // network, these must not be modified. |override_response_headers| can be set | 134 // network, these must not be modified. |override_response_headers| can be set |
134 // to new values, that should be considered as overriding | 135 // to new values, that should be considered as overriding |
135 // |original_response_headers|. | 136 // |original_response_headers|. |
136 // |callback|, |original_response_headers|, and |override_response_headers| | 137 // |callback|, |original_response_headers|, and |override_response_headers| |
137 // are only valid until OnURLRequestDestroyed is called for this request. | 138 // are only valid until OnURLRequestDestroyed is called for this request. |
138 // See OnBeforeURLRequest for return value description. Returns OK by default. | 139 // See OnBeforeURLRequest for return value description. Returns OK by default. |
139 virtual int OnHeadersReceived( | 140 virtual int OnHeadersReceived( |
140 URLRequest* request, | 141 URLRequest* request, |
141 const CompletionCallback& callback, | 142 const CompletionCallback& callback, |
142 const HttpResponseHeaders* original_response_headers, | 143 const HttpResponseHeaders* original_response_headers, |
143 scoped_refptr<HttpResponseHeaders>* override_response_headers); | 144 scoped_refptr<HttpResponseHeaders>* override_response_headers, |
| 145 GURL* allowed_unsafe_redirect_url); |
144 | 146 |
145 // Called right after a redirect response code was received. | 147 // Called right after a redirect response code was received. |
146 // |new_location| is only valid until OnURLRequestDestroyed is called for this | 148 // |new_location| is only valid until OnURLRequestDestroyed is called for this |
147 // request. | 149 // request. |
148 virtual void OnBeforeRedirect(URLRequest* request, | 150 virtual void OnBeforeRedirect(URLRequest* request, |
149 const GURL& new_location); | 151 const GURL& new_location); |
150 | 152 |
151 // This corresponds to URLRequestDelegate::OnResponseStarted. | 153 // This corresponds to URLRequestDelegate::OnResponseStarted. |
152 virtual void OnResponseStarted(URLRequest* request); | 154 virtual void OnResponseStarted(URLRequest* request); |
153 | 155 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 226 |
225 // Called before a SocketStream tries to connect. | 227 // Called before a SocketStream tries to connect. |
226 // See OnBeforeURLRequest for return value description. Returns OK by default. | 228 // See OnBeforeURLRequest for return value description. Returns OK by default. |
227 virtual int OnBeforeSocketStreamConnect( | 229 virtual int OnBeforeSocketStreamConnect( |
228 SocketStream* socket, const CompletionCallback& callback); | 230 SocketStream* socket, const CompletionCallback& callback); |
229 }; | 231 }; |
230 | 232 |
231 } // namespace net | 233 } // namespace net |
232 | 234 |
233 #endif // NET_BASE_NETWORK_DELEGATE_H_ | 235 #endif // NET_BASE_NETWORK_DELEGATE_H_ |
OLD | NEW |