| 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> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/linked_ptr.h" | 16 #include "base/memory/linked_ptr.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "content/public/common/resource_type.h" | 19 #include "content/public/common/resource_type.h" |
| 20 #include "extensions/browser/warning_set.h" | 20 #include "extensions/browser/warning_set.h" |
| 21 #include "net/base/auth.h" | 21 #include "net/base/auth.h" |
| 22 #include "net/cert/x509_certificate.h" |
| 22 #include "net/http/http_request_headers.h" | 23 #include "net/http/http_request_headers.h" |
| 23 #include "net/http/http_response_headers.h" | 24 #include "net/http/http_response_headers.h" |
| 25 #include "net/ssl/ssl_info.h" |
| 24 #include "url/gurl.h" | 26 #include "url/gurl.h" |
| 25 | 27 |
| 26 namespace base { | 28 namespace base { |
| 27 class ListValue; | 29 class ListValue; |
| 28 class DictionaryValue; | 30 class DictionaryValue; |
| 29 } | 31 } |
| 30 | 32 |
| 31 namespace extensions { | 33 namespace extensions { |
| 32 class Extension; | 34 class Extension; |
| 33 } | 35 } |
| 34 | 36 |
| 35 namespace net { | 37 namespace net { |
| 36 class NetLogWithSource; | 38 class NetLogWithSource; |
| 39 class X509Certificate; |
| 37 } | 40 } |
| 38 | 41 |
| 39 namespace extension_web_request_api_helpers { | 42 namespace extension_web_request_api_helpers { |
| 40 | 43 |
| 41 typedef std::pair<std::string, std::string> ResponseHeader; | 44 typedef std::pair<std::string, std::string> ResponseHeader; |
| 42 typedef std::vector<ResponseHeader> ResponseHeaders; | 45 typedef std::vector<ResponseHeader> ResponseHeaders; |
| 43 | 46 |
| 44 // Internal representation of the extraInfoSpec parameter on webRequest | 47 // Internal representation of the extraInfoSpec parameter on webRequest |
| 45 // events, used to specify extra information to be included with network | 48 // events, used to specify extra information to be included with network |
| 46 // events. | 49 // events. |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 // Returns a string representation of |type| or |other| if |type| is not handled | 339 // Returns a string representation of |type| or |other| if |type| is not handled |
| 337 // by the web request API. | 340 // by the web request API. |
| 338 const char* ResourceTypeToString(content::ResourceType type); | 341 const char* ResourceTypeToString(content::ResourceType type); |
| 339 | 342 |
| 340 // Stores a |content::ResourceType| representation in |types| if |type_str| is | 343 // Stores a |content::ResourceType| representation in |types| if |type_str| is |
| 341 // a resource type handled by the web request API. Returns true in case of | 344 // a resource type handled by the web request API. Returns true in case of |
| 342 // success. | 345 // success. |
| 343 bool ParseResourceType(const std::string& type_str, | 346 bool ParseResourceType(const std::string& type_str, |
| 344 std::vector<content::ResourceType>* types); | 347 std::vector<content::ResourceType>* types); |
| 345 | 348 |
| 349 // Returns a list of dictionaries containing various information about the chain |
| 350 // of certificates referenced by |cert|. Ownership is passed to the caller. |
| 351 base::ListValue* ExtractCertificateChain( |
| 352 scoped_refptr<net::X509Certificate> cert); |
| 353 |
| 354 // Returns a list of SSL errors contained within |status|. Ownership is passed |
| 355 // to the caller. |
| 356 base::ListValue* ParseCertificateStatusErrors(net::CertStatus status); |
| 357 |
| 346 } // namespace extension_web_request_api_helpers | 358 } // namespace extension_web_request_api_helpers |
| 347 | 359 |
| 348 #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 |