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 28 matching lines...) Expand all Loading... |
39 namespace net { | 39 namespace net { |
40 class BoundNetLog; | 40 class BoundNetLog; |
41 class URLRequest; | 41 class URLRequest; |
42 } | 42 } |
43 | 43 |
44 namespace extension_web_request_api_helpers { | 44 namespace extension_web_request_api_helpers { |
45 | 45 |
46 typedef std::pair<std::string, std::string> ResponseHeader; | 46 typedef std::pair<std::string, std::string> ResponseHeader; |
47 typedef std::vector<ResponseHeader> ResponseHeaders; | 47 typedef std::vector<ResponseHeader> ResponseHeaders; |
48 | 48 |
| 49 // Internal representation of the extraInfoSpec parameter on webRequest |
| 50 // events, used to specify extra information to be included with network |
| 51 // events. |
| 52 struct ExtraInfoSpec { |
| 53 enum Flags { |
| 54 REQUEST_HEADERS = 1 << 0, |
| 55 RESPONSE_HEADERS = 1 << 1, |
| 56 BLOCKING = 1 << 2, |
| 57 ASYNC_BLOCKING = 1 << 3, |
| 58 REQUEST_BODY = 1 << 4, |
| 59 }; |
| 60 |
| 61 static bool InitFromValue(const base::ListValue& value, int* extra_info_spec); |
| 62 }; |
| 63 |
49 // Data container for RequestCookies as defined in the declarative WebRequest | 64 // Data container for RequestCookies as defined in the declarative WebRequest |
50 // API definition. | 65 // API definition. |
51 struct RequestCookie { | 66 struct RequestCookie { |
52 RequestCookie(); | 67 RequestCookie(); |
53 ~RequestCookie(); | 68 ~RequestCookie(); |
54 scoped_ptr<std::string> name; | 69 scoped_ptr<std::string> name; |
55 scoped_ptr<std::string> value; | 70 scoped_ptr<std::string> value; |
56 private: | 71 private: |
57 DISALLOW_COPY_AND_ASSIGN(RequestCookie); | 72 DISALLOW_COPY_AND_ASSIGN(RequestCookie); |
58 }; | 73 }; |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 | 351 |
337 // Stores a |content::ResourceType| representation in |type| if |type_str| is | 352 // Stores a |content::ResourceType| representation in |type| if |type_str| is |
338 // a resource type handled by the web request API. Returns true in case of | 353 // a resource type handled by the web request API. Returns true in case of |
339 // success. | 354 // success. |
340 bool ParseResourceType(const std::string& type_str, | 355 bool ParseResourceType(const std::string& type_str, |
341 content::ResourceType* type); | 356 content::ResourceType* type); |
342 | 357 |
343 } // namespace extension_web_request_api_helpers | 358 } // namespace extension_web_request_api_helpers |
344 | 359 |
345 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ | 360 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_HELPERS_H_ |
OLD | NEW |