mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium version 97.0.4692.0 (#938553)
- Remove CefRequestContextHandler::OnBeforePluginLoad and CefRequestContext::PurgePluginListCache (fixes issue #3047). These methods stopped being relevant after the removal of Flash support in January 2021. The last remaining PPAPI plugin (PDF viewer) will switch to a non-plugin implementation in the near future (see https://crbug.com/702993#c58) and functionality related to plugin filtering has already been removed in https://crrev.com/343ae351c9.
This commit is contained in:
@@ -1,28 +1,27 @@
|
||||
diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc
|
||||
index 30017a7261496..ac208ec1fee24 100644
|
||||
index 2cf61c44809a9..e6948ab525700 100644
|
||||
--- chrome/browser/plugins/plugin_info_host_impl.cc
|
||||
+++ chrome/browser/plugins/plugin_info_host_impl.cc
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "base/task_runner_util.h"
|
||||
#include "base/task/task_runner_util.h"
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
+#include "cef/libcef/features/runtime.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"
|
||||
@@ -53,6 +54,11 @@
|
||||
@@ -53,6 +54,10 @@
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+#include "cef/libcef/browser/plugins/plugin_service_filter.h"
|
||||
+#include "cef/libcef/common/extensions/extensions_util.h"
|
||||
+#endif
|
||||
+
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#include "components/guest_view/browser/guest_view_base.h"
|
||||
#include "extensions/browser/extension_registry.h"
|
||||
@@ -102,6 +108,9 @@ bool IsPluginLoadingAccessibleResourceInWebView(
|
||||
@@ -102,6 +107,9 @@ bool IsPluginLoadingAccessibleResourceInWebView(
|
||||
extensions::ExtensionRegistry* extension_registry,
|
||||
int process_id,
|
||||
const GURL& resource) {
|
||||
@@ -32,7 +31,7 @@ index 30017a7261496..ac208ec1fee24 100644
|
||||
extensions::WebViewRendererState* renderer_state =
|
||||
extensions::WebViewRendererState::GetInstance();
|
||||
std::string partition_id;
|
||||
@@ -130,14 +139,18 @@ bool IsPluginLoadingAccessibleResourceInWebView(
|
||||
@@ -130,14 +138,18 @@ bool IsPluginLoadingAccessibleResourceInWebView(
|
||||
|
||||
PluginInfoHostImpl::Context::Context(int render_process_id, Profile* profile)
|
||||
: render_process_id_(render_process_id),
|
||||
@@ -54,68 +53,8 @@ index 30017a7261496..ac208ec1fee24 100644
|
||||
}
|
||||
|
||||
PluginInfoHostImpl::Context::~Context() {}
|
||||
@@ -217,6 +230,15 @@ void PluginInfoHostImpl::Context::DecidePluginStatus(
|
||||
PluginMetadata::SecurityStatus security_status,
|
||||
const std::string& plugin_identifier,
|
||||
chrome::mojom::PluginStatus* status) const {
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ // Don't override the user decision.
|
||||
+ if (cef::IsAlloyRuntimeEnabled() &&
|
||||
+ (*status == chrome::mojom::PluginStatus::kBlocked ||
|
||||
+ *status == chrome::mojom::PluginStatus::kDisabled)) {
|
||||
+ return;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
if (security_status == PluginMetadata::SECURITY_STATUS_FULLY_TRUSTED) {
|
||||
*status = chrome::mojom::PluginStatus::kAllowed;
|
||||
return;
|
||||
@@ -324,17 +346,41 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin(
|
||||
return false;
|
||||
}
|
||||
|
||||
+ const bool is_main_frame =
|
||||
+ main_frame_origin.IsSameOriginWith(url::Origin::Create(url));
|
||||
+ size_t i = 0;
|
||||
+
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ if (cef::IsAlloyRuntimeEnabled()) {
|
||||
+ CefPluginServiceFilter* filter = static_cast<CefPluginServiceFilter*>(
|
||||
+ PluginService::GetInstance()->GetFilter());
|
||||
+ DCHECK(filter);
|
||||
+
|
||||
+ for (; i < matching_plugins.size(); ++i) {
|
||||
+ if (filter->IsPluginAvailable(render_process_id_, render_frame_id,
|
||||
+ url, is_main_frame, main_frame_origin,
|
||||
+ &matching_plugins[i], status)) {
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+#endif // BUILDFLAG(ENABLE_CEF)
|
||||
+
|
||||
content::PluginServiceFilter* filter =
|
||||
PluginService::GetInstance()->GetFilter();
|
||||
- size_t i = 0;
|
||||
for (; i < matching_plugins.size(); ++i) {
|
||||
if (!filter ||
|
||||
filter->IsPluginAvailable(render_process_id_, render_frame_id, url,
|
||||
- main_frame_origin, &matching_plugins[i])) {
|
||||
+ is_main_frame, main_frame_origin,
|
||||
+ &matching_plugins[i])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
// If we broke out of the loop, we have found an enabled plugin.
|
||||
bool enabled = i < matching_plugins.size();
|
||||
if (!enabled) {
|
||||
diff --git chrome/browser/plugins/plugin_utils.cc chrome/browser/plugins/plugin_utils.cc
|
||||
index a0b3175223f3e..a1117001ad1fc 100644
|
||||
index 7999b960694ab..5c1848a0afadf 100644
|
||||
--- chrome/browser/plugins/plugin_utils.cc
|
||||
+++ chrome/browser/plugins/plugin_utils.cc
|
||||
@@ -5,6 +5,7 @@
|
||||
@@ -124,9 +63,9 @@ index a0b3175223f3e..a1117001ad1fc 100644
|
||||
#include "base/values.h"
|
||||
+#include "cef/libcef/features/runtime.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/common/plugin_utils.h"
|
||||
#include "components/content_settings/core/browser/host_content_settings_map.h"
|
||||
@@ -15,6 +16,10 @@
|
||||
#include "components/content_settings/core/common/content_settings_types.h"
|
||||
@@ -14,6 +15,10 @@
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
@@ -137,7 +76,7 @@ index a0b3175223f3e..a1117001ad1fc 100644
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
@@ -77,6 +82,12 @@ base::flat_map<std::string, std::string>
|
||||
@@ -69,6 +74,12 @@ base::flat_map<std::string, std::string>
|
||||
PluginUtils::GetMimeTypeToExtensionIdMap(
|
||||
content::BrowserContext* browser_context) {
|
||||
base::flat_map<std::string, std::string> mime_type_to_extension_id_map;
|
||||
@@ -186,10 +125,10 @@ index 8c2547056ec26..2ab3252dca708 100644
|
||||
// that the X-Frame-Options protection mechanism is set to either DENY or
|
||||
// SAMEORIGIN.
|
||||
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
|
||||
index 5ff5939031672..01742ddfef449 100644
|
||||
index 14c199c88ba6a..a4bb52c01c2f5 100644
|
||||
--- chrome/renderer/chrome_content_renderer_client.cc
|
||||
+++ chrome/renderer/chrome_content_renderer_client.cc
|
||||
@@ -943,6 +943,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -947,6 +947,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
|
||||
if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
|
||||
status == chrome::mojom::PluginStatus::kBlocked) &&
|
||||
@@ -197,7 +136,7 @@ index 5ff5939031672..01742ddfef449 100644
|
||||
content_settings_agent_delegate->IsPluginTemporarilyAllowed(
|
||||
identifier)) {
|
||||
status = chrome::mojom::PluginStatus::kAllowed;
|
||||
@@ -1144,7 +1145,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -1148,7 +1149,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
|
||||
plugin_auth_host.BindNewEndpointAndPassReceiver());
|
||||
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
|
||||
@@ -207,7 +146,7 @@ index 5ff5939031672..01742ddfef449 100644
|
||||
break;
|
||||
}
|
||||
case chrome::mojom::PluginStatus::kBlocked: {
|
||||
@@ -1153,7 +1155,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -1157,7 +1159,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
|
||||
placeholder->AllowLoading();
|
||||
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
|
||||
@@ -217,7 +156,7 @@ index 5ff5939031672..01742ddfef449 100644
|
||||
break;
|
||||
}
|
||||
case chrome::mojom::PluginStatus::kBlockedByPolicy: {
|
||||
@@ -1163,7 +1166,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -1167,7 +1170,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
group_name));
|
||||
RenderThread::Get()->RecordAction(
|
||||
UserMetricsAction("Plugin_BlockedByPolicy"));
|
||||
@@ -227,7 +166,7 @@ index 5ff5939031672..01742ddfef449 100644
|
||||
break;
|
||||
}
|
||||
case chrome::mojom::PluginStatus::kBlockedNoLoading: {
|
||||
@@ -1171,7 +1175,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
@@ -1175,7 +1179,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
|
||||
IDR_BLOCKED_PLUGIN_HTML,
|
||||
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING,
|
||||
group_name));
|
||||
@@ -238,10 +177,10 @@ index 5ff5939031672..01742ddfef449 100644
|
||||
}
|
||||
}
|
||||
diff --git content/browser/browser_plugin/browser_plugin_guest.h content/browser/browser_plugin/browser_plugin_guest.h
|
||||
index d596ac1b51e87..64dfdd8cddccb 100644
|
||||
index 567d0f56294f8..1526e57fc0aeb 100644
|
||||
--- content/browser/browser_plugin/browser_plugin_guest.h
|
||||
+++ content/browser/browser_plugin/browser_plugin_guest.h
|
||||
@@ -116,6 +116,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost,
|
||||
@@ -117,6 +117,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost,
|
||||
|
||||
gfx::Point GetScreenCoordinates(const gfx::Point& relative_position) const;
|
||||
|
||||
|
Reference in New Issue
Block a user