mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Delete Alloy bootstrap (fixes #3685)
This commit is contained in:
@ -1,110 +1,3 @@
|
||||
diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc
|
||||
index 0ca794a57bed3..ce171b7a01a8c 100644
|
||||
--- chrome/browser/plugins/plugin_info_host_impl.cc
|
||||
+++ chrome/browser/plugins/plugin_info_host_impl.cc
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "base/memory/singleton.h"
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
+#include "cef/libcef/features/features.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
||||
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
|
||||
@@ -140,6 +141,12 @@ bool IsPluginLoadingAccessibleResourceInWebView(
|
||||
extensions::ExtensionRegistry* extension_registry,
|
||||
int process_id,
|
||||
const GURL& resource) {
|
||||
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
||||
+ // May be nullptr if using CEF Alloy with extensions disabled.
|
||||
+ if (!extension_registry)
|
||||
+ return false;
|
||||
+#endif
|
||||
+
|
||||
extensions::WebViewRendererState* renderer_state =
|
||||
extensions::WebViewRendererState::GetInstance();
|
||||
std::string partition_id;
|
||||
diff --git chrome/browser/plugins/plugin_utils.cc chrome/browser/plugins/plugin_utils.cc
|
||||
index 00dd9a34cd3fb..89d4588bdbe4e 100644
|
||||
--- chrome/browser/plugins/plugin_utils.cc
|
||||
+++ chrome/browser/plugins/plugin_utils.cc
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "chrome/browser/plugins/plugin_utils.h"
|
||||
|
||||
#include "base/values.h"
|
||||
+#include "cef/libcef/features/features.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "components/content_settings/core/browser/host_content_settings_map.h"
|
||||
#include "components/content_settings/core/common/content_settings.h"
|
||||
@@ -69,6 +70,15 @@ PluginUtils::GetMimeTypeToExtensionIdMap(
|
||||
content::BrowserContext* browser_context) {
|
||||
base::flat_map<std::string, std::string> mime_type_to_extension_id_map;
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
+#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
||||
+ // May be nullptr if using CEF Alloy with extensions disabled.
|
||||
+ extensions::ExtensionRegistry* registry =
|
||||
+ extensions::ExtensionRegistry::Get(browser_context);
|
||||
+ if (!registry) {
|
||||
+ return mime_type_to_extension_id_map;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
Profile* profile = Profile::FromBrowserContext(browser_context);
|
||||
if (extensions::ChromeContentBrowserClientExtensionsPart::
|
||||
AreExtensionsDisabledForProfile(profile)) {
|
||||
@@ -79,9 +89,11 @@ PluginUtils::GetMimeTypeToExtensionIdMap(
|
||||
MimeTypesHandler::GetMIMETypeAllowlist();
|
||||
// Go through the allowed extensions and try to use them to intercept
|
||||
// the URL request.
|
||||
+#if !BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
|
||||
extensions::ExtensionRegistry* registry =
|
||||
extensions::ExtensionRegistry::Get(browser_context);
|
||||
DCHECK(registry);
|
||||
+#endif
|
||||
for (const std::string& extension_id : allowlist) {
|
||||
const extensions::Extension* extension =
|
||||
registry->enabled_extensions().GetByID(extension_id);
|
||||
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
|
||||
index 120ec8af72623..012f7b602cf40 100644
|
||||
--- chrome/renderer/chrome_content_renderer_client.cc
|
||||
+++ chrome/renderer/chrome_content_renderer_client.cc
|
||||
@@ -996,6 +996,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
|
||||
if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
|
||||
status == chrome::mojom::PluginStatus::kBlocked) &&
|
||||
+ content_settings_agent_delegate &&
|
||||
content_settings_agent_delegate->IsPluginTemporarilyAllowed(
|
||||
identifier)) {
|
||||
status = chrome::mojom::PluginStatus::kAllowed;
|
||||
@@ -1156,7 +1157,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
|
||||
plugin_auth_host.BindNewEndpointAndPassReceiver());
|
||||
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
|
||||
- content_settings_agent->DidBlockContentType(content_type);
|
||||
+ if (content_settings_agent)
|
||||
+ content_settings_agent->DidBlockContentType(content_type);
|
||||
break;
|
||||
}
|
||||
case chrome::mojom::PluginStatus::kBlocked: {
|
||||
@@ -1165,7 +1167,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
|
||||
placeholder->AllowLoading();
|
||||
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
|
||||
- content_settings_agent->DidBlockContentType(content_type);
|
||||
+ if (content_settings_agent)
|
||||
+ content_settings_agent->DidBlockContentType(content_type);
|
||||
break;
|
||||
}
|
||||
case chrome::mojom::PluginStatus::kBlockedByPolicy: {
|
||||
@@ -1175,7 +1178,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
group_name));
|
||||
RenderThread::Get()->RecordAction(
|
||||
UserMetricsAction("Plugin_BlockedByPolicy"));
|
||||
- content_settings_agent->DidBlockContentType(content_type);
|
||||
+ if (content_settings_agent)
|
||||
+ content_settings_agent->DidBlockContentType(content_type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
diff --git content/browser/browser_plugin/browser_plugin_embedder.h content/browser/browser_plugin/browser_plugin_embedder.h
|
||||
index ea2891a279371..595e5b8eb2cb6 100644
|
||||
--- content/browser/browser_plugin/browser_plugin_embedder.h
|
||||
|
Reference in New Issue
Block a user