blob: 4e7aa55a9aef2c0cba1ff4b2598e0ceee41cd67b [file] [log] [blame]
[email protected]1791e6c92014-04-11 08:29:011// 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.
4
lfg048201a2014-09-16 19:09:365#ifndef CHROME_BROWSER_EXTENSIONS_CHROME_URL_REQUEST_UTIL_H_
6#define CHROME_BROWSER_EXTENSIONS_CHROME_URL_REQUEST_UTIL_H_
[email protected]1791e6c92014-04-11 08:29:017
8#include <string>
9
10namespace base {
11class FilePath;
12}
13
14namespace net {
15class NetworkDelegate;
16class URLRequest;
17class URLRequestJob;
18}
19
20namespace extensions {
21class Extension;
22class InfoMap;
23
jamescook8816ae52014-09-05 17:02:3724// Utilities related to URLRequest jobs for extension resources. See
25// chrome/browser/extensions/extension_protocols_unittest.cc for related tests.
lfg048201a2014-09-16 19:09:3626namespace chrome_url_request_util {
[email protected]1791e6c92014-04-11 08:29:0127
lfg048201a2014-09-16 19:09:3628// Sets allowed=true to allow a chrome-extension:// resource request coming from
vivek.vg33f197b2014-09-17 15:26:1829// renderer A to access a resource in an extension running in renderer B.
lfg048201a2014-09-16 19:09:3630// Returns false when it couldn't determine if the resource is allowed or not
[email protected]1791e6c92014-04-11 08:29:0131bool AllowCrossRendererResourceLoad(net::URLRequest* request,
lfg3be30332014-09-18 15:47:2632 bool is_incognito,
33 const Extension* extension,
34 InfoMap* extension_info_map,
35 bool* allowed);
[email protected]1791e6c92014-04-11 08:29:0136
37// Creates a URLRequestJob for loading component extension resources out of
38// a Chrome resource bundle. Returns NULL if the requested resource is not a
39// component extension resource.
40net::URLRequestJob* MaybeCreateURLRequestResourceBundleJob(
41 net::URLRequest* request,
42 net::NetworkDelegate* network_delegate,
43 const base::FilePath& directory_path,
44 const std::string& content_security_policy,
45 bool send_cors_header);
46
lfg048201a2014-09-16 19:09:3647} // namespace chrome_url_request_util
[email protected]1791e6c92014-04-11 08:29:0148} // namespace extensions
49
lfg048201a2014-09-16 19:09:3650#endif // CHROME_BROWSER_EXTENSIONS_CHROME_URL_REQUEST_UTIL_H_