| 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 CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // only. | 198 // only. |
| 199 void OnSendHeaders(void* profile, | 199 void OnSendHeaders(void* profile, |
| 200 extensions::InfoMap* extension_info_map, | 200 extensions::InfoMap* extension_info_map, |
| 201 net::URLRequest* request, | 201 net::URLRequest* request, |
| 202 const net::HttpRequestHeaders& headers); | 202 const net::HttpRequestHeaders& headers); |
| 203 | 203 |
| 204 // Dispatches the onHeadersReceived event. This is fired for HTTP(s) | 204 // Dispatches the onHeadersReceived event. This is fired for HTTP(s) |
| 205 // requests only, and allows modification of incoming response headers. | 205 // requests only, and allows modification of incoming response headers. |
| 206 // Returns net::ERR_IO_PENDING if an extension is intercepting the request, | 206 // Returns net::ERR_IO_PENDING if an extension is intercepting the request, |
| 207 // OK otherwise. |original_response_headers| is reference counted. |callback| | 207 // OK otherwise. |original_response_headers| is reference counted. |callback| |
| 208 // and |override_response_headers| are owned by a URLRequestJob. They are | 208 // |override_response_headers| and |allowed_unsafe_redirect_url| are owned by |
| 209 // guaranteed to be valid until |callback| is called or OnURLRequestDestroyed | 209 // a URLRequestJob. They are guaranteed to be valid until |callback| is called |
| 210 // is called (whatever comes first). | 210 // or OnURLRequestDestroyed is called (whatever comes first). |
| 211 // Do not modify |original_response_headers| directly but write new ones | 211 // Do not modify |original_response_headers| directly but write new ones |
| 212 // into |override_response_headers|. | 212 // into |override_response_headers|. |
| 213 int OnHeadersReceived( | 213 int OnHeadersReceived( |
| 214 void* profile, | 214 void* profile, |
| 215 extensions::InfoMap* extension_info_map, | 215 extensions::InfoMap* extension_info_map, |
| 216 net::URLRequest* request, | 216 net::URLRequest* request, |
| 217 const net::CompletionCallback& callback, | 217 const net::CompletionCallback& callback, |
| 218 const net::HttpResponseHeaders* original_response_headers, | 218 const net::HttpResponseHeaders* original_response_headers, |
| 219 scoped_refptr<net::HttpResponseHeaders>* override_response_headers); | 219 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, |
| 220 GURL* allowed_unsafe_redirect_url); |
| 220 | 221 |
| 221 // Dispatches the OnAuthRequired event to any extensions whose filters match | 222 // Dispatches the OnAuthRequired event to any extensions whose filters match |
| 222 // the given request. If the listener is not registered as "blocking", then | 223 // the given request. If the listener is not registered as "blocking", then |
| 223 // AUTH_REQUIRED_RESPONSE_OK is returned. Otherwise, | 224 // AUTH_REQUIRED_RESPONSE_OK is returned. Otherwise, |
| 224 // AUTH_REQUIRED_RESPONSE_IO_PENDING is returned and |callback| will be | 225 // AUTH_REQUIRED_RESPONSE_IO_PENDING is returned and |callback| will be |
| 225 // invoked later. | 226 // invoked later. |
| 226 net::NetworkDelegate::AuthRequiredResponse OnAuthRequired( | 227 net::NetworkDelegate::AuthRequiredResponse OnAuthRequired( |
| 227 void* profile, | 228 void* profile, |
| 228 extensions::InfoMap* extension_info_map, | 229 extensions::InfoMap* extension_info_map, |
| 229 net::URLRequest* request, | 230 net::URLRequest* request, |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 virtual void OnQuotaExceeded(const std::string& error) OVERRIDE; | 519 virtual void OnQuotaExceeded(const std::string& error) OVERRIDE; |
| 519 virtual bool RunImpl() OVERRIDE; | 520 virtual bool RunImpl() OVERRIDE; |
| 520 }; | 521 }; |
| 521 | 522 |
| 522 // Send updates to |host| with information about what webRequest-related | 523 // Send updates to |host| with information about what webRequest-related |
| 523 // extensions are installed. | 524 // extensions are installed. |
| 524 // TODO(mpcomplete): remove. http://crbug.com/100411 | 525 // TODO(mpcomplete): remove. http://crbug.com/100411 |
| 525 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host); | 526 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host); |
| 526 | 527 |
| 527 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ | 528 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ |
| OLD | NEW |