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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_URL_REQUEST_UTIL_H_
6 #define CHROME_BROWSER_EXTENSIONS_URL_REQUEST_UTIL_H_
15 class NetworkDelegate
;
20 namespace extensions
{
24 // Utilities related to URLRequest jobs for extension resources.
25 namespace url_request_util
{
27 // Returns true to allow a chrome-extension:// resource request coming from
28 // renderer A to access a resource in an extension running in renderer B.
29 bool AllowCrossRendererResourceLoad(net::URLRequest
* request
,
31 const Extension
* extension
,
32 InfoMap
* extension_info_map
);
34 // Creates a URLRequestJob for loading component extension resources out of
35 // a Chrome resource bundle. Returns NULL if the requested resource is not a
36 // component extension resource.
37 net::URLRequestJob
* MaybeCreateURLRequestResourceBundleJob(
38 net::URLRequest
* request
,
39 net::NetworkDelegate
* network_delegate
,
40 const base::FilePath
& directory_path
,
41 const std::string
& content_security_policy
,
42 bool send_cors_header
);
44 // Returns true if |request| corresponds to a resource request from a
46 bool IsWebViewRequest(net::URLRequest
* request
);
48 } // namespace url_request_util
49 } // namespace extensions
51 #endif // CHROME_BROWSER_EXTENSIONS_URL_REQUEST_UTIL_H_