summaryrefslogtreecommitdiff
path: root/chromium/chrome/common/pepper_permission_util.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-03-05 14:36:22 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-03-05 14:37:32 +0100
commit28db9b54de6402bd38770ecc1d620255e9d1e78f (patch)
tree469a957ff6b9b6d0ee9fb4074b9139cbaa050443 /chromium/chrome/common/pepper_permission_util.h
parent3239a38a9b35d29e483b7bd67b786b4f9d109908 (diff)
parent248b70b82a40964d5594eb04feca0fa36716185d (diff)
downloadqtwebengine-chromium-28db9b54de6402bd38770ecc1d620255e9d1e78f.tar.gz
Merge remote-tracking branch 'origin/upstream-master' into 79-based
Conflicts: chromium/chrome/common/pref_names.cc chromium/chrome/common/pref_names.h Change-Id: I9be20fb8dfd946e3db1fa298dce076db5fd1f397
Diffstat (limited to 'chromium/chrome/common/pepper_permission_util.h')
-rw-r--r--chromium/chrome/common/pepper_permission_util.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/chromium/chrome/common/pepper_permission_util.h b/chromium/chrome/common/pepper_permission_util.h
new file mode 100644
index 00000000000..b2793e80c35
--- /dev/null
+++ b/chromium/chrome/common/pepper_permission_util.h
@@ -0,0 +1,37 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_COMMON_PEPPER_PERMISSION_UTIL_H_
+#define CHROME_COMMON_PEPPER_PERMISSION_UTIL_H_
+
+#include <set>
+#include <string>
+
+class GURL;
+
+namespace extensions {
+class ExtensionSet;
+}
+
+// Returns true if the extension (or an imported module if any) is whitelisted.
+// Module imports are at most one level deep (ie, a module that exports cannot
+// import another extension). The extension is identified by the host of |url|
+// (if it is a chrome-extension URL). |extension_set| is the list of installed
+// and enabled extensions for a given profile. |whitelist| is a set of
+// (possibly hashed) extension IDs to check against.
+bool IsExtensionOrSharedModuleWhitelisted(
+ const GURL& url,
+ const extensions::ExtensionSet* extension_set,
+ const std::set<std::string>& whitelist);
+
+// Checks whether the host of |url| is allowed by |command_line_switch|.
+//
+// If the value of |command_line_switch| is:
+// (1) '*': returns true for any packaged or platform apps;
+// (2) a list of host names separated by ',': returns true if |host| is in the
+// list. (NOTE: In this case, |url| doesn't have to belong to an extension.)
+bool IsHostAllowedByCommandLine(const GURL& url,
+ const extensions::ExtensionSet* extension_set,
+ const char* command_line_switch);
+#endif // CHROME_COMMON_PEPPER_PERMISSION_UTIL_H_