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 |
44 typedef std::pair<std::string, std::string> ResponseHeader; | 45 typedef std::pair<std::string, std::string> ResponseHeader; |
45 typedef std::vector<ResponseHeader> ResponseHeaders; | 46 typedef std::vector<ResponseHeader> ResponseHeaders; |
46 | 47 |
47 // Data container for RequestCookies as defined in the declarative WebRequest | 48 // Data container for RequestCookies as defined in the declarative WebRequest |
48 // API definition. | 49 // API definition. |
49 struct RequestCookie { | 50 struct RequestCookie { |
50 RequestCookie(); | 51 RequestCookie(); |
51 ~RequestCookie(); | 52 ~RequestCookie(); |
52 scoped_ptr<std::string> name; | 53 scoped_ptr<std::string> name; |
53 scoped_ptr<std::string> value; | 54 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 | 314 // collect UMA statistics on Page Load Times. Needs to be called on the UI |
314 // thread. | 315 // thread. |
315 void NotifyWebRequestAPIUsed( | 316 void NotifyWebRequestAPIUsed( |
316 void* browser_context_id, | 317 void* browser_context_id, |
317 scoped_refptr<const extensions::Extension> extension); | 318 scoped_refptr<const extensions::Extension> extension); |
318 | 319 |
319 // Send updates to |host| with information about what webRequest-related | 320 // Send updates to |host| with information about what webRequest-related |
320 // extensions are installed. | 321 // extensions are installed. |
321 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host); | 322 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host); |
322 | 323 |
| 324 // Converts the |name|, |value| pair of a http header to a HttpHeaders |
| 325 // dictionary. Ownership is passed to the caller. |
| 326 base::DictionaryValue* CreateHeaderDictionary( |
| 327 const std::string& name, const std::string& value); |
| 328 |
323 } // namespace extension_web_request_api_helpers | 329 } // namespace extension_web_request_api_helpers |
324 | 330 |
325 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ | 331 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ |
OLD | NEW |