| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_URL_REQUEST_UTIL_H_ | 5 #ifndef EXTENSIONS_BROWSER_URL_REQUEST_UTIL_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_URL_REQUEST_UTIL_H_ | 6 #define EXTENSIONS_BROWSER_URL_REQUEST_UTIL_H_ |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 namespace base { | |
| 11 class FilePath; | |
| 12 } | |
| 13 | 7 |
| 14 namespace net { | 8 namespace net { |
| 15 class NetworkDelegate; | |
| 16 class URLRequest; | 9 class URLRequest; |
| 17 class URLRequestJob; | |
| 18 } | 10 } |
| 19 | 11 |
| 20 namespace extensions { | 12 namespace extensions { |
| 21 class Extension; | 13 class Extension; |
| 22 class InfoMap; | 14 class InfoMap; |
| 23 | 15 |
| 24 // Utilities related to URLRequest jobs for extension resources. See | 16 // Utilities related to URLRequest jobs for extension resources. See |
| 25 // chrome/browser/extensions/extension_protocols_unittest.cc for related tests. | 17 // chrome/browser/extensions/extension_protocols_unittest.cc for related tests. |
| 26 namespace url_request_util { | 18 namespace url_request_util { |
| 27 | 19 |
| 28 // Returns true to allow a chrome-extension:// resource request coming from | 20 // Returns true to allow a chrome-extension:// resource request coming from |
| 29 // renderer A to access a resource in an extension running in renderer B. | 21 // renderer A to access a resource in an extension running in renderer B. |
| 30 bool AllowCrossRendererResourceLoad(net::URLRequest* request, | 22 bool AllowCrossRendererResourceLoad(net::URLRequest* request, |
| 31 bool is_incognito, | 23 bool is_incognito, |
| 32 const Extension* extension, | 24 const Extension* extension, |
| 33 InfoMap* extension_info_map); | 25 InfoMap* extension_info_map); |
| 34 | 26 |
| 35 // Creates a URLRequestJob for loading component extension resources out of | |
| 36 // a Chrome resource bundle. Returns NULL if the requested resource is not a | |
| 37 // component extension resource. | |
| 38 net::URLRequestJob* MaybeCreateURLRequestResourceBundleJob( | |
| 39 net::URLRequest* request, | |
| 40 net::NetworkDelegate* network_delegate, | |
| 41 const base::FilePath& directory_path, | |
| 42 const std::string& content_security_policy, | |
| 43 bool send_cors_header); | |
| 44 | |
| 45 // Returns true if |request| corresponds to a resource request from a | 27 // Returns true if |request| corresponds to a resource request from a |
| 46 // <webview>. | 28 // <webview>. |
| 47 bool IsWebViewRequest(net::URLRequest* request); | 29 bool IsWebViewRequest(net::URLRequest* request); |
| 48 | 30 |
| 49 } // namespace url_request_util | 31 } // namespace url_request_util |
| 50 } // namespace extensions | 32 } // namespace extensions |
| 51 | 33 |
| 52 #endif // CHROME_BROWSER_EXTENSIONS_URL_REQUEST_UTIL_H_ | 34 #endif // EXTENSIONS_BROWSER_URL_REQUEST_UTIL_H_ |
| OLD | NEW |