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

Side by Side Diff: chrome/common/pepper_permission_util.h

Issue 264923011: Add a whitelist check for nacl-nonsfi mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add includes (windows compile fail) Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/common/pepper_permission_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_COMMON_PEPPER_PERMISSION_UTIL_H_ 5 #ifndef CHROME_COMMON_PEPPER_PERMISSION_UTIL_H_
6 #define CHROME_COMMON_PEPPER_PERMISSION_UTIL_H_ 6 #define CHROME_COMMON_PEPPER_PERMISSION_UTIL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
11 class GURL; 11 class GURL;
12 12
13 namespace extensions { 13 namespace extensions {
14 class ExtensionSet; 14 class ExtensionSet;
15 } 15 }
16 16
17 namespace chrome { 17 namespace chrome {
18 18
19 // Returns true if the extension (or an imported module if any) is whitelisted. 19 // Returns true if the extension (or an imported module if any) is whitelisted.
20 // Module imports are at most one level deep (ie, a module that exports cannot
21 // import another extension). The extension is identified by the host of |url|
22 // (if it is a chrome-extension URL). |extension_set| is the list of installed
23 // and enabled extensions for a given profile. |whitelist| is a set of
24 // (possibly hashed) extension IDs to check against.
20 bool IsExtensionOrSharedModuleWhitelisted( 25 bool IsExtensionOrSharedModuleWhitelisted(
21 const GURL& url, 26 const GURL& url,
22 const extensions::ExtensionSet* extension_set, 27 const extensions::ExtensionSet* extension_set,
23 const std::set<std::string>& whitelist); 28 const std::set<std::string>& whitelist);
24 29
25 // Checks whether the host of |url| is allowed by |command_line_switch|. 30 // Checks whether the host of |url| is allowed by |command_line_switch|.
26 // 31 //
27 // If the value of |command_line_switch| is: 32 // If the value of |command_line_switch| is:
28 // (1) '*': returns true for any packaged or platform apps; 33 // (1) '*': returns true for any packaged or platform apps;
29 // (2) a list of host names separated by ',': returns true if |host| is in the 34 // (2) a list of host names separated by ',': returns true if |host| is in the
30 // list. (NOTE: In this case, |url| doesn't have to belong to an extension.) 35 // list. (NOTE: In this case, |url| doesn't have to belong to an extension.)
31 bool IsHostAllowedByCommandLine(const GURL& url, 36 bool IsHostAllowedByCommandLine(const GURL& url,
32 const extensions::ExtensionSet* extension_set, 37 const extensions::ExtensionSet* extension_set,
33 const char* command_line_switch); 38 const char* command_line_switch);
34 } // namespace chrome 39 } // namespace chrome
35 40
36 #endif // CHROME_COMMON_PEPPER_PERMISSION_UTIL_H_ 41 #endif // CHROME_COMMON_PEPPER_PERMISSION_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | chrome/common/pepper_permission_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698