Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: chrome/browser/extensions/url_request_util.h

Issue 573843002: Allows webview to access extension resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix problems with early returns. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 CHROME_BROWSER_EXTENSIONS_URL_REQUEST_UTIL_H_
6 #define CHROME_BROWSER_EXTENSIONS_URL_REQUEST_UTIL_H_ 6 #define CHROME_BROWSER_EXTENSIONS_URL_REQUEST_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 namespace base { 10 namespace base {
11 class FilePath; 11 class FilePath;
12 } 12 }
13 13
14 namespace net { 14 namespace net {
15 class NetworkDelegate; 15 class NetworkDelegate;
16 class URLRequest; 16 class URLRequest;
17 class URLRequestJob; 17 class URLRequestJob;
18 } 18 }
19 19
20 namespace extensions { 20 namespace extensions {
21 class Extension; 21 class Extension;
22 class InfoMap; 22 class InfoMap;
23 23
24 // Utilities related to URLRequest jobs for extension resources. See 24 // Utilities related to URLRequest jobs for extension resources. See
25 // chrome/browser/extensions/extension_protocols_unittest.cc for related tests. 25 // chrome/browser/extensions/extension_protocols_unittest.cc for related tests.
26 namespace url_request_util { 26 namespace url_request_util {
27 27
28 // Returns true to allow a chrome-extension:// resource request coming from 28 // Sets allowed=true to allow a chrome-extension:// resource request coming from
29 // renderer A to access a resource in an extension running in renderer B. 29 // renderer A to access a resource in an extension running in renderer B.\
30 bool AllowCrossRendererResourceLoad(net::URLRequest* request, 30 // Returns false when it couldn't determine if the resource is allowed or not
31 bool is_incognito, 31 bool ChromeAllowCrossRendererResourceLoad(net::URLRequest* request,
Ken Rockot(use gerrit already) 2014/09/16 16:50:52 Or you could change the namespace to chrome_url_re
32 const Extension* extension, 32 bool is_incognito,
33 InfoMap* extension_info_map); 33 const Extension* extension,
34 InfoMap* extension_info_map,
35 bool* allowed);
34 36
35 // Creates a URLRequestJob for loading component extension resources out of 37 // Creates a URLRequestJob for loading component extension resources out of
36 // a Chrome resource bundle. Returns NULL if the requested resource is not a 38 // a Chrome resource bundle. Returns NULL if the requested resource is not a
37 // component extension resource. 39 // component extension resource.
38 net::URLRequestJob* MaybeCreateURLRequestResourceBundleJob( 40 net::URLRequestJob* MaybeCreateURLRequestResourceBundleJob(
39 net::URLRequest* request, 41 net::URLRequest* request,
40 net::NetworkDelegate* network_delegate, 42 net::NetworkDelegate* network_delegate,
41 const base::FilePath& directory_path, 43 const base::FilePath& directory_path,
42 const std::string& content_security_policy, 44 const std::string& content_security_policy,
43 bool send_cors_header); 45 bool send_cors_header);
44 46
45 // Returns true if |request| corresponds to a resource request from a
46 // <webview>.
47 bool IsWebViewRequest(net::URLRequest* request);
48
49 } // namespace url_request_util 47 } // namespace url_request_util
50 } // namespace extensions 48 } // namespace extensions
51 49
52 #endif // CHROME_BROWSER_EXTENSIONS_URL_REQUEST_UTIL_H_ 50 #endif // CHROME_BROWSER_EXTENSIONS_URL_REQUEST_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/chrome_extensions_browser_client.cc ('k') | chrome/browser/extensions/url_request_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698