chore: bump chromium to 131.0.6734.0 (main) (#43769)

* chore: bump chromium in DEPS to 130.0.6723.4

* chore: bump chromium in DEPS to 131.0.6724.0

* chore: update patches

* chore: update libc++ filenames

* 5844369: controlledframe: Disable Web Bluetooth for <webview> & <controlledframe>
5844369

* (multiple CLs): Use an opaque type for FrameTreeNode IDs

5807683: Use an opaque type for FrameTreeNode IDs, part 1 | 5807683
5829746: Use an opaque type for FrameTreeNode IDs, part 2 | 5829746
5836903: Use an opaque type for FrameTreeNode IDs, part 7 | 5836903
5837249: Use an opaque type for FrameTreeNode IDs, part 8 | 5837249
5836564: Use an opaque type for FrameTreeNode IDs, part 12 | 5836564
5837180: Use an opaque type for FrameTreeNode IDs, part 15 | 5837180

* 5822889: [task] Make GetForegroundTaskRunner non-virtual
5822889

* 5833297: Remove unused inner WebContents attach params
5833297

* 5806403: Shift PowerMonitor to non static
5806403

* 5666874: [3/N] Remove old OnPowerChange in PowerObserver
5666874

* 5829085: [v8] Differentiate between UserVisible and BestEffort task runners
5829085

* 5791112: [webrtc] Use `c/b/permissions/system` for system permissions
5791112

* 5825636: [Extensions] Create WebContentsObservers with ExtensionsBrowserClient
5825636

* fixup! (multiple CLs): Use an opaque type for FrameTreeNode IDs

* fixup! 5791112: [webrtc] Use `c/b/permissions/system` for system permissions 5791112

* chore: bump chromium in DEPS to 131.0.6726.0

* chore: update patches

* chore: update libc++ filenames

* 5858119: Declutter: Allow opening to a specific feature
5858119

* fix: macOS SDK 15 error

Not sure exactly what changed in the upgrade to macOS SDK 15, but it triggered a new error:

```
electron/shell/browser/ui/message_box_mac.mm:84:7: error: multiple methods named 'highlight:' found with mismatched result, parameter type or attributes
```

The `highlight:` selector a few lines down was ambiguous because the object type of the `NSArray` was not specified. Specifying `NSButton` as the element type makes the selector unambiguous for type checking.

* 5854143: [File Download Access Prevention] Obfuscate download file for enterprise deep scan
5854143

* 5854811: Use kNotAllowedError instead of kSecurityError for Web MIDI
5854811

* chore: bump chromium in DEPS to 131.0.6728.0

* chore: update patches

* disable invalid test

* chore: bump chromium in DEPS to 131.0.6730.0

* chore: update patches

* update build tools target commit for new macOS SDK

* chore: update libc++ file names

* chore: bump chromium in DEPS to 131.0.6732.0

* chore: bump chromium in DEPS to 131.0.6734.0

* 5856527: [UI] Use mojo enum for `WindowShowState` in ui/

5856527

* chore: update build-tools sha to include macOD 15.0 SDK

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: alice <alice@makenotion.com>
This commit is contained in:
electron-roller[bot] 2024-09-25 06:19:39 -05:00 committed by GitHub
parent af54c5a4b6
commit 30fbeec036
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
108 changed files with 625 additions and 538 deletions

View file

@ -68,9 +68,10 @@ PowerMonitor::PowerMonitor(v8::Isolate* isolate) {
&PowerMonitor::ShouldShutdown, base::Unretained(this)));
#endif
base::PowerMonitor::AddPowerStateObserver(this);
base::PowerMonitor::AddPowerSuspendObserver(this);
base::PowerMonitor::AddPowerThermalObserver(this);
auto* power_monitor = base::PowerMonitor::GetInstance();
power_monitor->AddPowerStateObserver(this);
power_monitor->AddPowerSuspendObserver(this);
power_monitor->AddPowerThermalObserver(this);
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
InitPlatformSpecificMonitors();
@ -78,20 +79,29 @@ PowerMonitor::PowerMonitor(v8::Isolate* isolate) {
}
PowerMonitor::~PowerMonitor() {
base::PowerMonitor::RemovePowerStateObserver(this);
base::PowerMonitor::RemovePowerSuspendObserver(this);
base::PowerMonitor::RemovePowerThermalObserver(this);
auto* power_monitor = base::PowerMonitor::GetInstance();
power_monitor->RemovePowerStateObserver(this);
power_monitor->RemovePowerSuspendObserver(this);
power_monitor->RemovePowerThermalObserver(this);
}
bool PowerMonitor::ShouldShutdown() {
return !Emit("shutdown");
}
void PowerMonitor::OnPowerStateChange(bool on_battery_power) {
if (on_battery_power)
Emit("on-battery");
else
Emit("on-ac");
void PowerMonitor::OnBatteryPowerStatusChange(
BatteryPowerStatus battery_power_status) {
switch (battery_power_status) {
case BatteryPowerStatus::kBatteryPower:
Emit("on-battery");
break;
case BatteryPowerStatus::kExternalPower:
Emit("on-ac");
break;
case BatteryPowerStatus::kUnknown:
// Ignored
break;
}
}
void PowerMonitor::OnSuspend() {
@ -175,11 +185,11 @@ int GetSystemIdleTime() {
}
bool IsOnBatteryPower() {
return base::PowerMonitor::IsOnBatteryPower();
return base::PowerMonitor::GetInstance()->IsOnBatteryPower();
}
base::PowerThermalObserver::DeviceThermalState GetCurrentThermalState() {
return base::PowerMonitor::GetCurrentThermalState();
return base::PowerMonitor::GetInstance()->GetCurrentThermalState();
}
void Initialize(v8::Local<v8::Object> exports,

View file

@ -52,7 +52,8 @@ class PowerMonitor final : public gin::Wrappable<PowerMonitor>,
#endif
// base::PowerStateObserver implementations:
void OnPowerStateChange(bool on_battery_power) override;
void OnBatteryPowerStatusChange(
BatteryPowerStatus battery_power_status) override;
// base::PowerSuspendObserver implementations:
void OnSuspend() override;

View file

@ -93,8 +93,8 @@ AVMediaType ParseMediaType(const std::string& media_type) {
}
std::string ConvertSystemPermission(
system_media_permissions::SystemPermission value) {
using SystemPermission = system_media_permissions::SystemPermission;
system_permission_settings::SystemPermission value) {
using SystemPermission = system_permission_settings::SystemPermission;
switch (value) {
case SystemPermission::kNotDetermined:
return "not-determined";
@ -548,13 +548,13 @@ std::string SystemPreferences::GetMediaAccessStatus(
const std::string& media_type) {
if (media_type == "camera") {
return ConvertSystemPermission(
system_media_permissions::CheckSystemVideoCapturePermission());
system_permission_settings::CheckSystemVideoCapturePermission());
} else if (media_type == "microphone") {
return ConvertSystemPermission(
system_media_permissions::CheckSystemAudioCapturePermission());
system_permission_settings::CheckSystemAudioCapturePermission());
} else if (media_type == "screen") {
return ConvertSystemPermission(
system_media_permissions::CheckSystemScreenCapturePermission());
system_permission_settings::CheckSystemScreenCapturePermission());
} else {
thrower.ThrowError("Invalid media type");
return std::string();

View file

@ -658,7 +658,8 @@ bool IsDevToolsFileSystemAdded(content::WebContents* web_contents,
content::RenderFrameHost* GetRenderFrameHost(
content::NavigationHandle* navigation_handle) {
int frame_tree_node_id = navigation_handle->GetFrameTreeNodeId();
content::FrameTreeNodeId frame_tree_node_id =
navigation_handle->GetFrameTreeNodeId();
content::FrameTreeNode* frame_tree_node =
content::FrameTreeNode::GloballyFindByID(frame_tree_node_id);
content::RenderFrameHostManager* render_manager =
@ -1698,7 +1699,7 @@ void WebContents::RenderFrameHostChanged(content::RenderFrameHost* old_host,
}
}
void WebContents::FrameDeleted(int frame_tree_node_id) {
void WebContents::FrameDeleted(content::FrameTreeNodeId frame_tree_node_id) {
auto* web_frame = WebFrameMain::FromFrameTreeNodeId(frame_tree_node_id);
if (web_frame)
web_frame->Destroyed();

View file

@ -25,6 +25,7 @@
#include "content/common/frame.mojom-forward.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/frame_tree_node_id.h"
#include "content/public/browser/javascript_dialog_manager.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/web_contents_delegate.h"
@ -637,7 +638,7 @@ class WebContents final : public ExclusiveAccessContext,
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
void RenderFrameHostChanged(content::RenderFrameHost* old_host,
content::RenderFrameHost* new_host) override;
void FrameDeleted(int frame_tree_node_id) override;
void FrameDeleted(content::FrameTreeNodeId frame_tree_node_id) override;
void RenderViewDeleted(content::RenderViewHost*) override;
void PrimaryMainFrameRenderProcessGone(
base::TerminationStatus status) override;

View file

@ -18,10 +18,10 @@ namespace electron::api {
void WebContents::DetachFromOuterFrame() {
// See detach_webview_frame.patch on how to detach.
int frame_tree_node_id =
content::FrameTreeNodeId frame_tree_node_id =
static_cast<content::WebContentsImpl*>(web_contents())
->GetOuterDelegateFrameTreeNodeId();
if (frame_tree_node_id != content::FrameTreeNode::kFrameTreeNodeInvalidId) {
if (!frame_tree_node_id) {
auto* node = content::FrameTreeNode::GloballyFindByID(frame_tree_node_id);
DCHECK(node->parent());
node->frame_tree().RemoveFrame(node);

View file

@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/no_destructor.h"
#include "content/browser/renderer_host/render_frame_host_impl.h" // nogncheck
#include "content/public/browser/frame_tree_node_id.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/common/isolated_world_ids.h"
#include "electron/shell/common/api/api.mojom.h"
@ -56,7 +57,10 @@ struct Converter<blink::mojom::PageVisibilityState> {
namespace electron::api {
typedef std::unordered_map<int, WebFrameMain*> WebFrameMainIdMap;
typedef std::unordered_map<content::FrameTreeNodeId,
WebFrameMain*,
content::FrameTreeNodeId::Hasher>
WebFrameMainIdMap;
WebFrameMainIdMap& GetWebFrameMainMap() {
static base::NoDestructor<WebFrameMainIdMap> instance;
@ -64,7 +68,8 @@ WebFrameMainIdMap& GetWebFrameMainMap() {
}
// static
WebFrameMain* WebFrameMain::FromFrameTreeNodeId(int frame_tree_node_id) {
WebFrameMain* WebFrameMain::FromFrameTreeNodeId(
content::FrameTreeNodeId frame_tree_node_id) {
WebFrameMainIdMap& frame_map = GetWebFrameMainMap();
auto iter = frame_map.find(frame_tree_node_id);
auto* web_frame = iter == frame_map.end() ? nullptr : iter->second;
@ -270,8 +275,8 @@ void WebFrameMain::PostMessage(v8::Isolate* isolate,
std::move(transferable_message));
}
int WebFrameMain::FrameTreeNodeID() const {
return frame_tree_node_id_;
int WebFrameMain::FrameTreeNodeIDAsInt() const {
return frame_tree_node_id_.value();
}
std::string WebFrameMain::Name() const {
@ -406,7 +411,7 @@ void WebFrameMain::FillObjectTemplate(v8::Isolate* isolate,
.SetMethod("reload", &WebFrameMain::Reload)
.SetMethod("_send", &WebFrameMain::Send)
.SetMethod("_postMessage", &WebFrameMain::PostMessage)
.SetProperty("frameTreeNodeId", &WebFrameMain::FrameTreeNodeID)
.SetProperty("frameTreeNodeId", &WebFrameMain::FrameTreeNodeIDAsInt)
.SetProperty("name", &WebFrameMain::Name)
.SetProperty("osProcessId", &WebFrameMain::OSProcessID)
.SetProperty("processId", &WebFrameMain::ProcessID)

View file

@ -12,6 +12,7 @@
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/process/process.h"
#include "content/public/browser/frame_tree_node_id.h"
#include "gin/wrappable.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
@ -53,7 +54,8 @@ class WebFrameMain final : public gin::Wrappable<WebFrameMain>,
static gin::Handle<WebFrameMain> FromOrNull(
v8::Isolate* isolate,
content::RenderFrameHost* render_frame_host);
static WebFrameMain* FromFrameTreeNodeId(int frame_tree_node_id);
static WebFrameMain* FromFrameTreeNodeId(
content::FrameTreeNodeId frame_tree_node_id);
static WebFrameMain* FromRenderFrameHost(
content::RenderFrameHost* render_frame_host);
@ -110,7 +112,7 @@ class WebFrameMain final : public gin::Wrappable<WebFrameMain>,
v8::Local<v8::Value> message_value,
std::optional<v8::Local<v8::Value>> transfer);
int FrameTreeNodeID() const;
int FrameTreeNodeIDAsInt() const;
std::string Name() const;
base::ProcessId OSProcessID() const;
int ProcessID() const;
@ -129,7 +131,7 @@ class WebFrameMain final : public gin::Wrappable<WebFrameMain>,
mojo::Remote<mojom::ElectronRenderer> renderer_api_;
mojo::PendingReceiver<mojom::ElectronRenderer> pending_receiver_;
int frame_tree_node_id_;
content::FrameTreeNodeId frame_tree_node_id_;
raw_ptr<content::RenderFrameHost> render_frame_ = nullptr;