chore: bump chromium to 129.0.6650.0 (main) (#43266)

* chore: bump chromium in DEPS to 129.0.6645.0

* chore: update patches

* chore: bump chromium in DEPS to 129.0.6646.0

* refactor: remove ppapi dependency

PPAPI removal - https://issues.chromium.org/issues/40511450
PDF viewer migration - https://issues.chromium.org/issues/40511452

* chore: update patches

* chore: enable `content_enable_legacy_ipc`

We were indirectly relying on this via `enable_ppapi=true`, with
633a57d9b62da7850ef7946f6b101ed440d04cdd ppapi is now disabled and
this commit makes the dependency explicit.

* fix: gn check

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
This commit is contained in:
electron-roller[bot] 2024-08-12 10:28:33 +02:00 committed by GitHub
parent 23bcca3ffc
commit c9b7806418
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
65 changed files with 333 additions and 673 deletions

View file

@ -1,107 +0,0 @@
// Copyright (c) 2012 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.
#include "shell/renderer/electron_renderer_pepper_host_factory.h"
#include <memory>
#include <string>
#include "content/public/renderer/renderer_ppapi_host.h"
#include "ppapi/host/dispatch_host_message.h"
#include "ppapi/host/ppapi_host.h"
#include "ppapi/host/resource_host.h"
#include "ppapi/proxy/ppapi_message_utils.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
using ppapi::host::ResourceHost;
// Stub class which ignores all messages
class PepperUMAHost : public ppapi::host::ResourceHost {
public:
PepperUMAHost(content::RendererPpapiHost* host,
PP_Instance instance,
PP_Resource resource)
: ResourceHost(host->GetPpapiHost(), instance, resource) {}
~PepperUMAHost() override = default;
// ppapi::host::ResourceMessageHandler implementation.
int32_t OnResourceMessageReceived(
const IPC::Message& msg,
ppapi::host::HostMessageContext* context) override {
PPAPI_BEGIN_MESSAGE_MAP(PepperUMAHost, msg)
PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_UMA_HistogramCustomTimes,
OnHistogramCustomTimes)
PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_UMA_HistogramCustomCounts,
OnHistogramCustomCounts)
PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_UMA_HistogramEnumeration,
OnHistogramEnumeration)
PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(
PpapiHostMsg_UMA_IsCrashReportingEnabled, OnIsCrashReportingEnabled)
PPAPI_END_MESSAGE_MAP()
return PP_ERROR_FAILED;
}
private:
int32_t OnHistogramCustomTimes(ppapi::host::HostMessageContext* context,
const std::string& name,
int64_t sample,
int64_t min,
int64_t max,
uint32_t bucket_count) {
return PP_OK;
}
int32_t OnHistogramCustomCounts(ppapi::host::HostMessageContext* context,
const std::string& name,
int32_t sample,
int32_t min,
int32_t max,
uint32_t bucket_count) {
return PP_OK;
}
int32_t OnHistogramEnumeration(ppapi::host::HostMessageContext* context,
const std::string& name,
int32_t sample,
int32_t boundary_value) {
return PP_OK;
}
int32_t OnIsCrashReportingEnabled(ppapi::host::HostMessageContext* context) {
return PP_OK;
}
};
ElectronRendererPepperHostFactory::ElectronRendererPepperHostFactory(
content::RendererPpapiHost* host)
: host_(host) {}
ElectronRendererPepperHostFactory::~ElectronRendererPepperHostFactory() =
default;
std::unique_ptr<ResourceHost>
ElectronRendererPepperHostFactory::CreateResourceHost(
ppapi::host::PpapiHost* host,
PP_Resource resource,
PP_Instance instance,
const IPC::Message& message) {
DCHECK_EQ(host_->GetPpapiHost(), host);
// Make sure the plugin is giving us a valid instance for this resource.
if (!host_->IsValidInstance(instance))
return nullptr;
// Permissions for the following interfaces will be checked at the
// time of the corresponding instance's method calls. Currently these
// interfaces are available only for specifically permitted apps which may
// not have access to the other private interfaces.
switch (message.type()) {
case PpapiHostMsg_UMA_Create::ID: {
return std::make_unique<PepperUMAHost>(host_, instance, resource);
}
}
return nullptr;
}

View file

@ -1,40 +0,0 @@
// Copyright (c) 2012 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 ELECTRON_SHELL_RENDERER_ELECTRON_RENDERER_PEPPER_HOST_FACTORY_H_
#define ELECTRON_SHELL_RENDERER_ELECTRON_RENDERER_PEPPER_HOST_FACTORY_H_
#include <memory>
#include "base/memory/raw_ptr.h"
#include "ppapi/host/host_factory.h"
namespace content {
class RendererPpapiHost;
}
class ElectronRendererPepperHostFactory : public ppapi::host::HostFactory {
public:
explicit ElectronRendererPepperHostFactory(content::RendererPpapiHost* host);
~ElectronRendererPepperHostFactory() override;
// disable copy
ElectronRendererPepperHostFactory(const ElectronRendererPepperHostFactory&) =
delete;
ElectronRendererPepperHostFactory& operator=(
const ElectronRendererPepperHostFactory&) = delete;
// ppapi::host::HostFactory
std::unique_ptr<ppapi::host::ResourceHost> CreateResourceHost(
ppapi::host::PpapiHost* host,
PP_Resource resource,
PP_Instance instance,
const IPC::Message& message) override;
private:
// Not owned by this object.
raw_ptr<content::RendererPpapiHost> host_;
};
#endif // ELECTRON_SHELL_RENDERER_ELECTRON_RENDERER_PEPPER_HOST_FACTORY_H_

View file

@ -1,33 +0,0 @@
// Copyright (c) 2012 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.
#include "shell/renderer/pepper_helper.h"
#include <memory>
#include "chrome/renderer/pepper/chrome_renderer_pepper_host_factory.h"
#include "chrome/renderer/pepper/pepper_shared_memory_message_filter.h"
#include "content/public/renderer/renderer_ppapi_host.h"
#include "electron/shell/renderer/electron_renderer_pepper_host_factory.h"
#include "ppapi/host/ppapi_host.h"
PepperHelper::PepperHelper(content::RenderFrame* render_frame)
: RenderFrameObserver(render_frame) {}
PepperHelper::~PepperHelper() = default;
void PepperHelper::DidCreatePepperPlugin(content::RendererPpapiHost* host) {
// TODO(brettw) figure out how to hook up the host factory. It needs some
// kind of filter-like system to allow dynamic additions.
host->GetPpapiHost()->AddHostFactoryFilter(
std::make_unique<ChromeRendererPepperHostFactory>(host));
host->GetPpapiHost()->AddHostFactoryFilter(
std::make_unique<ElectronRendererPepperHostFactory>(host));
host->GetPpapiHost()->AddInstanceMessageFilter(
std::make_unique<PepperSharedMemoryMessageFilter>(host));
}
void PepperHelper::OnDestruct() {
delete this;
}

View file

@ -1,27 +0,0 @@
// Copyright (c) 2012 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 ELECTRON_SHELL_RENDERER_PEPPER_HELPER_H_
#define ELECTRON_SHELL_RENDERER_PEPPER_HELPER_H_
#include "content/public/renderer/render_frame_observer.h"
// This class listens for Pepper creation events from the RenderFrame and
// attaches the parts required for plugin support.
class PepperHelper : private content::RenderFrameObserver {
public:
explicit PepperHelper(content::RenderFrame* render_frame);
~PepperHelper() override;
// disable copy
PepperHelper(const PepperHelper&) = delete;
PepperHelper& operator=(const PepperHelper&) = delete;
private:
// RenderFrameObserver.
void DidCreatePepperPlugin(content::RendererPpapiHost* host) override;
void OnDestruct() override;
};
#endif // ELECTRON_SHELL_RENDERER_PEPPER_HELPER_H_

View file

@ -28,6 +28,7 @@
#include "shell/common/node_includes.h"
#include "shell/common/node_util.h"
#include "shell/common/options_switches.h"
#include "shell/common/plugin.mojom.h"
#include "shell/common/world_ids.h"
#include "shell/renderer/api/context_bridge/object_cache.h"
#include "shell/renderer/api/electron_api_context_bridge.h"
@ -35,6 +36,7 @@
#include "shell/renderer/content_settings_observer.h"
#include "shell/renderer/electron_api_service_impl.h"
#include "shell/renderer/electron_autofill_agent.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "third_party/blink/public/platform/web_runtime_features.h"
@ -80,7 +82,6 @@
#if BUILDFLAG(ENABLE_PLUGINS)
#include "shell/common/plugin_info.h"
#include "shell/renderer/pepper_helper.h"
#endif // BUILDFLAG(ENABLE_PLUGINS)
#if BUILDFLAG(ENABLE_PRINTING)
@ -332,9 +333,6 @@ void RendererClientBase::RenderFrameCreated(
#if defined(TOOLKIT_VIEWS)
new AutofillAgent(render_frame,
render_frame->GetAssociatedInterfaceRegistry());
#endif
#if BUILDFLAG(ENABLE_PLUGINS)
new PepperHelper(render_frame);
#endif
new ContentSettingsObserver(render_frame);
#if BUILDFLAG(ENABLE_PRINTING)
@ -423,32 +421,29 @@ bool RendererClientBase::IsPluginHandledExternally(
#if BUILDFLAG(ENABLE_PDF_VIEWER)
DCHECK(plugin_element.HasHTMLTagName("object") ||
plugin_element.HasHTMLTagName("embed"));
if (mime_type == pdf::kInternalPluginMimeType) {
mojo::AssociatedRemote<mojom::ElectronPluginInfoHost> plugin_info_host;
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
&plugin_info_host);
mojom::PluginInfoPtr plugin_info = mojom::PluginInfo::New();
plugin_info_host->GetPluginInfo(
original_url, render_frame->GetWebFrame()->Top()->GetSecurityOrigin(),
mime_type, &plugin_info);
if (plugin_info->actual_mime_type == pdf::kInternalPluginMimeType) {
if (IsPdfInternalPluginAllowedOrigin(
render_frame->GetWebFrame()->GetSecurityOrigin())) {
return true;
}
content::WebPluginInfo info;
info.type = content::WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS;
info.name = base::ASCIIToUTF16(kPDFInternalPluginName);
info.path = base::FilePath(kPdfPluginPath);
info.background_color = content::WebPluginInfo::kDefaultBackgroundColor;
info.mime_types.emplace_back(pdf::kInternalPluginMimeType, "pdf",
"Portable Document Format");
return extensions::MimeHandlerViewContainerManager::Get(
content::RenderFrame::FromWebFrame(
plugin_element.GetDocument().GetFrame()),
true /* create_if_does_not_exist */)
->CreateFrameContainer(plugin_element, original_url, mime_type, info);
}
return extensions::MimeHandlerViewContainerManager::Get(
content::RenderFrame::FromWebFrame(
plugin_element.GetDocument().GetFrame()),
true /* create_if_does_not_exist */)
->CreateFrameContainer(plugin_element, original_url, mime_type,
GetPDFPluginInfo());
->CreateFrameContainer(plugin_element, original_url,
plugin_info->actual_mime_type,
plugin_info->plugin);
#else
return false;
#endif