Chromium Code Reviews| 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 // Helper classes and functions used for the WebRequest API. | 5 // Helper classes and functions used for the WebRequest API. |
| 6 | 6 |
| 7 #ifndef EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ | 7 #ifndef EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ |
| 8 #define EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ | 8 #define EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 class Extension; | 34 class Extension; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace net { | 37 namespace net { |
| 38 class BoundNetLog; | 38 class BoundNetLog; |
| 39 class URLRequest; | 39 class URLRequest; |
| 40 } | 40 } |
| 41 | 41 |
| 42 namespace extension_web_request_api_helpers { | 42 namespace extension_web_request_api_helpers { |
| 43 | 43 |
| 44 #define ARRAYEND(array) (array + arraysize(array)) | |
|
Ken Rockot(use gerrit already)
2014/09/19 20:52:27
Please don't define a macro like this in a header.
Xi Han
2014/09/19 22:05:55
Removed the macro.
On 2014/09/19 20:52:27, Ken
| |
| 45 | |
| 44 typedef std::pair<std::string, std::string> ResponseHeader; | 46 typedef std::pair<std::string, std::string> ResponseHeader; |
| 45 typedef std::vector<ResponseHeader> ResponseHeaders; | 47 typedef std::vector<ResponseHeader> ResponseHeaders; |
| 46 | 48 |
| 47 // Data container for RequestCookies as defined in the declarative WebRequest | 49 // Data container for RequestCookies as defined in the declarative WebRequest |
| 48 // API definition. | 50 // API definition. |
| 49 struct RequestCookie { | 51 struct RequestCookie { |
| 50 RequestCookie(); | 52 RequestCookie(); |
| 51 ~RequestCookie(); | 53 ~RequestCookie(); |
| 52 scoped_ptr<std::string> name; | 54 scoped_ptr<std::string> name; |
| 53 scoped_ptr<std::string> value; | 55 scoped_ptr<std::string> value; |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 313 // collect UMA statistics on Page Load Times. Needs to be called on the UI | 315 // collect UMA statistics on Page Load Times. Needs to be called on the UI |
| 314 // thread. | 316 // thread. |
| 315 void NotifyWebRequestAPIUsed( | 317 void NotifyWebRequestAPIUsed( |
| 316 void* browser_context_id, | 318 void* browser_context_id, |
| 317 scoped_refptr<const extensions::Extension> extension); | 319 scoped_refptr<const extensions::Extension> extension); |
| 318 | 320 |
| 319 // Send updates to |host| with information about what webRequest-related | 321 // Send updates to |host| with information about what webRequest-related |
| 320 // extensions are installed. | 322 // extensions are installed. |
| 321 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host); | 323 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host); |
| 322 | 324 |
| 325 // Converts the |name|, |value| pair of a http header to a HttpHeaders | |
| 326 // dictionary. Ownership is passed to the caller. | |
| 327 base::DictionaryValue* ToHeaderDictionary( | |
| 328 const std::string& name, const std::string& value); | |
| 329 | |
| 323 } // namespace extension_web_request_api_helpers | 330 } // namespace extension_web_request_api_helpers |
| 324 | 331 |
| 325 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ | 332 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ |
| OLD | NEW |