summaryrefslogtreecommitdiff
path: root/chromium/extensions/browser/process_map.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-07-16 11:45:35 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-07-17 08:59:23 +0000
commit552906b0f222c5d5dd11b9fd73829d510980461a (patch)
tree3a11e6ed0538a81dd83b20cf3a4783e297f26d91 /chromium/extensions/browser/process_map.cc
parent1b05827804eaf047779b597718c03e7d38344261 (diff)
downloadqtwebengine-chromium-552906b0f222c5d5dd11b9fd73829d510980461a.tar.gz
BASELINE: Update Chromium to 83.0.4103.122
Change-Id: Ie3a82f5bb0076eec2a7c6a6162326b4301ee291e Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/extensions/browser/process_map.cc')
-rw-r--r--chromium/extensions/browser/process_map.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/chromium/extensions/browser/process_map.cc b/chromium/extensions/browser/process_map.cc
index 306b2c154fa..8e3e788d4d5 100644
--- a/chromium/extensions/browser/process_map.cc
+++ b/chromium/extensions/browser/process_map.cc
@@ -7,6 +7,7 @@
#include <tuple>
#include "content/public/browser/child_process_security_policy.h"
+#include "content/public/common/url_constants.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/process_map_factory.h"
#include "extensions/common/extension.h"
@@ -107,16 +108,27 @@ std::set<std::string> ProcessMap::GetExtensionsInProcess(int process_id) const {
Feature::Context ProcessMap::GetMostLikelyContextType(
const Extension* extension,
- int process_id) const {
+ int process_id,
+ const GURL* url) const {
// WARNING: This logic must match ScriptContextSet::ClassifyJavaScriptContext,
// as much as possible.
+ // TODO(crbug.com/1055168): Move this into the !extension if statement below
+ // or document why we want to return WEBUI_CONTEXT for content scripts in
+ // WebUIs.
+ // TODO(crbug.com/1055656): HasWebUIBindings does not always return true for
+ // WebUIs. This should be changed to use something else.
if (content::ChildProcessSecurityPolicy::GetInstance()->HasWebUIBindings(
process_id)) {
return Feature::WEBUI_CONTEXT;
}
if (!extension) {
+ // Note that blob/filesystem schemes associated with an inner URL of
+ // chrome-untrusted will be considered regular pages.
+ if (url && url->SchemeIs(content::kChromeUIUntrustedScheme))
+ return Feature::WEBUI_UNTRUSTED_CONTEXT;
+
return Feature::WEB_PAGE_CONTEXT;
}