chore: bump chromium to 136.0.7095.0 (main) (#46118)

* chore: bump chromium in DEPS to 136.0.7076.0

* chore: bump chromium in DEPS to 136.0.7077.0

* 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | 6368856

* 6356528: Clean up LegacyRenderWidgetHostHWND code | 6356528

* chore: export patches

* 6339113: [Viewport Segments] Add CDP commands to override Viewport Segments without overriding other device properties. | 6339113

* 6352169: [DevTools][MultiInstance] Support new tab in another window on Android | 6352169

* 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | 6368856

* 6360858:Clickiness: Wire response from URLLoader to DB, add e2e tests| 6360858

* chore: bump chromium in DEPS to 136.0.7079.0

* chore: export patches

* chore: bump chromium in DEPS to 136.0.7081.0

* chore: export patches

* chore: bump chromium in DEPS to 136.0.7083.0

* 6361987: Remove double-declaration with gfx::NativeView and gfx::NativeWindow | 6361987

* chore: export patches

* chore: bump chromium in DEPS to 136.0.7087.0

* chore: export patches

* fix: include node patch for missing AtomicsWaitEvent
6385540

* build: add depot_tools python to path

* fix: cppgc init and unregistering v8 isolate

6333562

CppGc is now initialized earlier so Node can skip reinitializing it.

Additionally, gin::IsolateHandle was attempting to destruct an already destructed
v8::Isolate upon electron::JavaScriptEnvironment destruction. By removing the call
to NodePlatform::UnregisterIsolate, this fixes the crash on app shutdown.

* fix: unregister isolate after destruction

See code comment.

* chore: bump chromium in DEPS to 136.0.7095.0

* chore: sync patches

* fix: add script_parsing::ContentScriptType parameter
6298395

* fix: migrate content::BrowserAccessibilityState methods
6401437
6383275

* feat: enableHappyEyeballs option for host resolver
6332599

* fix: add new cookie exclusion reason
6343479

* fix: add new url loader method
6337340

* fix: add new cppgc header file for electron_node headers
6348644

* fix: disable CREL on Linux ARM64
https://chromium-review.googlesource.com/q/I3a62f02f564f07be63173b0773b4ecaffbe939b9

* fixup! fix: add new cppgc header file for electron_node headers 6348644

* chore: update corner smoothing patch

* fixup! chore: update corner smoothing patch

* chore: disable NAN weak tests

These two tests are incompatible with a V8 change that disallows running JS code from a weak finalizer callback.

Ref: 4733273

* test: fix task starvation in node test

A V8 change makes these contexts get collected in a task that is posted
and run asynchronously. The tests were synchronously GC'ing in an
infinite loop, preventing the task loop from running the task that would
GC these contexts.

This change should be upstreamed in some way.

Ref: 4733273

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: alice <alice@makenotion.com>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: clavin <clavin@electronjs.org>
This commit is contained in:
electron-roller[bot] 2025-04-03 19:02:49 -05:00 committed by GitHub
parent 0a5da83a1b
commit 9c019b6147
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
110 changed files with 1645 additions and 589 deletions

View file

@ -1155,7 +1155,7 @@ void App::DisableDomainBlockingFor3DAPIs(gin_helper::ErrorThrower thrower) {
bool App::IsAccessibilitySupportEnabled() {
auto* ax_state = content::BrowserAccessibilityState::GetInstance();
return ax_state->IsAccessibleBrowser();
return ax_state->GetAccessibilityMode() == ui::kAXModeComplete;
}
void App::SetAccessibilitySupportEnabled(gin_helper::ErrorThrower thrower,
@ -1169,9 +1169,9 @@ void App::SetAccessibilitySupportEnabled(gin_helper::ErrorThrower thrower,
auto* ax_state = content::BrowserAccessibilityState::GetInstance();
if (enabled) {
ax_state->OnScreenReaderDetected();
ax_state->EnableProcessAccessibility();
} else {
ax_state->DisableAccessibility();
ax_state->DisableProcessAccessibility();
}
Browser::Get()->OnAccessibilitySupportChanged();
}
@ -1629,6 +1629,8 @@ void ConfigureHostResolver(v8::Isolate* isolate,
bool enable_built_in_resolver =
base::FeatureList::IsEnabled(net::features::kAsyncDns);
bool enable_happy_eyeballs_v3 =
base::FeatureList::IsEnabled(net::features::kHappyEyeballsV3);
bool additional_dns_query_types_enabled = true;
if (opts.Has("enableBuiltInResolver") &&
@ -1637,6 +1639,12 @@ void ConfigureHostResolver(v8::Isolate* isolate,
return;
}
if (opts.Has("enableHappyEyeballs") &&
!opts.Get("enableHappyEyeballs", &enable_happy_eyeballs_v3)) {
thrower.ThrowTypeError("enableHappyEyeballs must be a boolean");
return;
}
if (opts.Has("secureDnsMode") &&
!opts.Get("secureDnsMode", &secure_dns_mode)) {
thrower.ThrowTypeError(
@ -1677,8 +1685,8 @@ void ConfigureHostResolver(v8::Isolate* isolate,
// Configure the stub resolver. This must be done after the system
// NetworkContext is created, but before anything has the chance to use it.
content::GetNetworkService()->ConfigureStubHostResolver(
enable_built_in_resolver, secure_dns_mode, doh_config,
additional_dns_query_types_enabled);
enable_built_in_resolver, enable_happy_eyeballs_v3, secure_dns_mode,
doh_config, additional_dns_query_types_enabled);
}
// static

View file

@ -250,7 +250,10 @@ const std::string InclusionStatusToString(net::CookieInclusionStatus status) {
{Reason::EXCLUDE_THIRD_PARTY_PHASEOUT,
"The cookie is blocked for third-party cookie phaseout."},
{Reason::EXCLUDE_NO_COOKIE_CONTENT,
"The cookie contains no content or only whitespace."}});
"The cookie contains no content or only whitespace."},
{Reason::EXCLUDE_ANONYMOUS_CONTEXT,
"The cookie is unpartitioned and being accessed from an anonymous "
"context."}});
static_assert(
Reasons.size() ==
net::CookieInclusionStatus::ExclusionReasonBitset::kValueCount,

View file

@ -470,7 +470,9 @@ ExtensionFunction::ResponseAction ScriptingExecuteScriptFunction::Run() {
constexpr bool kRequiresLocalization = false;
std::string error;
if (!CheckAndLoadFiles(
std::move(*injection_.files), *extension(), kRequiresLocalization,
std::move(*injection_.files),
script_parsing::ContentScriptType::kJs, *extension(),
kRequiresLocalization,
base::BindOnce(&ScriptingExecuteScriptFunction::DidLoadResources,
this),
&error)) {
@ -609,7 +611,9 @@ ExtensionFunction::ResponseAction ScriptingInsertCSSFunction::Run() {
constexpr bool kRequiresLocalization = true;
std::string error;
if (!CheckAndLoadFiles(
std::move(*injection_.files), *extension(), kRequiresLocalization,
std::move(*injection_.files),
script_parsing::ContentScriptType::kCss, *extension(),
kRequiresLocalization,
base::BindOnce(&ScriptingInsertCSSFunction::DidLoadResources, this),
&error)) {
return RespondNow(Error(std::move(error)));
@ -723,8 +727,9 @@ ExtensionFunction::ResponseAction ScriptingRemoveCSSFunction::Run() {
if (injection.files) {
std::vector<ExtensionResource> resources;
if (!scripting::GetFileResources(*injection.files, *extension(), &resources,
&error)) {
if (!scripting::GetFileResources(*injection.files,
script_parsing::ContentScriptType::kCss,
*extension(), &resources, &error)) {
return RespondNow(Error(std::move(error)));
}

View file

@ -32,8 +32,9 @@ namespace electron {
namespace {
gin::IsolateHolder CreateIsolateHolder(v8::Isolate* isolate,
size_t* max_young_generation_size) {
std::unique_ptr<gin::IsolateHolder> CreateIsolateHolder(
v8::Isolate* isolate,
size_t* max_young_generation_size) {
std::unique_ptr<v8::Isolate::CreateParams> create_params =
gin::IsolateHolder::getDefaultIsolateParams();
// The value is needed to adjust heap limit when capturing
@ -45,14 +46,12 @@ gin::IsolateHolder CreateIsolateHolder(v8::Isolate* isolate,
// This is necessary for important aspects of Node.js
// including heap and cpu profilers to function properly.
return {base::SingleThreadTaskRunner::GetCurrentDefault(),
gin::IsolateHolder::kSingleThread,
gin::IsolateHolder::IsolateType::kUtility,
std::move(create_params),
gin::IsolateHolder::IsolateCreationMode::kNormal,
nullptr,
nullptr,
isolate};
return std::make_unique<gin::IsolateHolder>(
base::SingleThreadTaskRunner::GetCurrentDefault(),
gin::IsolateHolder::kSingleThread,
gin::IsolateHolder::IsolateType::kUtility, std::move(create_params),
gin::IsolateHolder::IsolateCreationMode::kNormal, nullptr, nullptr,
isolate);
}
} // namespace
@ -62,8 +61,8 @@ JavascriptEnvironment::JavascriptEnvironment(uv_loop_t* event_loop,
: isolate_holder_{CreateIsolateHolder(
Initialize(event_loop, setup_wasm_streaming),
&max_young_generation_size_)},
isolate_{isolate_holder_.isolate()},
locker_{isolate_} {
isolate_{isolate_holder_->isolate()},
locker_{std::make_unique<v8::Locker>(isolate_)} {
isolate_->Enter();
v8::HandleScope scope(isolate_);
@ -83,6 +82,12 @@ JavascriptEnvironment::~JavascriptEnvironment() {
isolate_->Exit();
g_isolate = nullptr;
// Deinit gin::IsolateHolder prior to calling NodePlatform::UnregisterIsolate.
// Otherwise cppgc::internal::Sweeper::Start will try to request a task runner
// from the NodePlatform with an already unregistered isolate.
locker_.reset();
isolate_holder_.reset();
platform_->UnregisterIsolate(isolate_);
}
@ -139,7 +144,7 @@ v8::Isolate* JavascriptEnvironment::GetIsolate() {
void JavascriptEnvironment::CreateMicrotasksRunner() {
DCHECK(!microtasks_runner_);
microtasks_runner_ = std::make_unique<MicrotasksRunner>(isolate());
isolate_holder_.WillCreateMicrotasksRunner();
isolate_holder_->WillCreateMicrotasksRunner();
base::CurrentThread::Get()->AddTaskObserver(microtasks_runner_.get());
}
@ -148,7 +153,7 @@ void JavascriptEnvironment::DestroyMicrotasksRunner() {
// Should be called before running gin_helper::CleanedUpAtExit::DoCleanup.
// This helps to signal wrappable finalizer callbacks to not act on freed
// parameters.
isolate_holder_.WillDestroyMicrotasksRunner();
isolate_holder_->WillDestroyMicrotasksRunner();
{
v8::HandleScope scope(isolate_);
gin_helper::CleanedUpAtExit::DoCleanup();

View file

@ -47,13 +47,13 @@ class JavascriptEnvironment {
std::unique_ptr<node::MultiIsolatePlatform> platform_;
size_t max_young_generation_size_ = 0;
gin::IsolateHolder isolate_holder_;
std::unique_ptr<gin::IsolateHolder> isolate_holder_;
// owned-by: isolate_holder_
const raw_ptr<v8::Isolate> isolate_;
// depends-on: isolate_
const v8::Locker locker_;
std::unique_ptr<v8::Locker> locker_;
std::unique_ptr<MicrotasksRunner> microtasks_runner_;
};

View file

@ -193,7 +193,9 @@ inline void dispatch_sync_main(dispatch_block_t block) {
- (id)accessibilityAttributeValue:(NSString*)attribute {
if ([attribute isEqualToString:@"AXManualAccessibility"]) {
auto* ax_state = content::BrowserAccessibilityState::GetInstance();
return [NSNumber numberWithBool:ax_state->IsAccessibleBrowser()];
bool is_accessible_browser =
ax_state->GetAccessibilityMode() == ui::kAXModeComplete;
return [NSNumber numberWithBool:is_accessible_browser];
}
return [super accessibilityAttributeValue:attribute];
@ -209,9 +211,9 @@ inline void dispatch_sync_main(dispatch_block_t block) {
if ([attribute isEqualToString:@"AXEnhancedUserInterface"] || is_manual_ax) {
auto* ax_state = content::BrowserAccessibilityState::GetInstance();
if ([value boolValue]) {
ax_state->OnScreenReaderDetected();
ax_state->EnableProcessAccessibility();
} else {
ax_state->DisableAccessibility();
ax_state->DisableProcessAccessibility();
}
electron::Browser::Get()->OnAccessibilitySupportChanged();

View file

@ -58,7 +58,7 @@ class BrowserView;
}
#if BUILDFLAG(IS_MAC)
typedef NSView* NativeWindowHandle;
typedef gfx::NativeView NativeWindowHandle;
#else
typedef gfx::AcceleratedWidget NativeWindowHandle;
#endif

View file

@ -1193,11 +1193,11 @@ void NativeWindowMac::SetParentWindow(NativeWindow* parent) {
}
gfx::NativeView NativeWindowMac::GetNativeView() const {
return [window_ contentView];
return gfx::NativeView([window_ contentView]);
}
gfx::NativeWindow NativeWindowMac::GetNativeWindow() const {
return window_;
return gfx::NativeWindow(window_);
}
gfx::AcceleratedWidget NativeWindowMac::GetAcceleratedWidget() const {
@ -1220,7 +1220,7 @@ content::DesktopMediaID NativeWindowMac::GetDesktopMediaID() const {
}
NativeWindowHandle NativeWindowMac::GetNativeWindowHandle() const {
return [window_ contentView];
return GetNativeView();
}
void NativeWindowMac::SetProgressBar(double progress,
@ -1451,7 +1451,7 @@ void NativeWindowMac::SetVibrancy(const std::string& type, int duration) {
// other views.
vibrant_native_view_host_ = rootView->AddChildViewAt(
std::make_unique<views::NativeViewHost>(), 0);
vibrant_native_view_host_->Attach(vibrantView);
vibrant_native_view_host_->Attach(gfx::NativeView(vibrantView));
rootView->DeprecatedLayoutImmediately();

View file

@ -281,8 +281,8 @@ bool NativeWindowViews::PreHandleMSG(UINT message,
checked_for_a11y_support_ = true;
auto* const axState = content::BrowserAccessibilityState::GetInstance();
if (axState && !axState->IsAccessibleBrowser()) {
axState->OnScreenReaderDetected();
if (axState && axState->GetAccessibilityMode() != ui::kAXModeComplete) {
axState->EnableProcessAccessibility();
Browser::Get()->OnAccessibilitySupportChanged();
}

View file

@ -271,6 +271,7 @@ void SystemNetworkContextManager::OnNetworkServiceCreated(
// NetworkContext is created, but before anything has the chance to use it.
content::GetNetworkService()->ConfigureStubHostResolver(
base::FeatureList::IsEnabled(net::features::kAsyncDns),
base::FeatureList::IsEnabled(net::features::kHappyEyeballsV3),
default_secure_dns_mode, doh_config, additional_dns_query_types_enabled);
// The OSCrypt keys are process bound, so if network service is out of

View file

@ -70,11 +70,15 @@ class URLLoaderNetworkObserver
const std::optional<std::string>& private_network_device_id,
const std::optional<std::string>& private_network_device_name,
OnPrivateNetworkAccessPermissionRequiredCallback callback) override {}
void OnLocalNetworkAccessPermissionRequired(
OnLocalNetworkAccessPermissionRequiredCallback callback) override {}
void OnUrlLoaderConnectedToPrivateNetwork(
const GURL& request_url,
network::mojom::IPAddressSpace response_address_space,
network::mojom::IPAddressSpace client_address_space,
network::mojom::IPAddressSpace target_address_space) override {}
void OnAdAuctionEventRecordHeaderReceived(
network::AdAuctionEventRecord event_record) override {}
void Clone(
mojo::PendingReceiver<network::mojom::URLLoaderNetworkServiceObserver>
observer) override;

View file

@ -150,7 +150,8 @@ class OffScreenRenderWidgetHostView
void TransformPointToRootSurface(gfx::PointF* point) override {}
gfx::Rect GetBoundsInRootWindow() override;
std::optional<content::DisplayFeature> GetDisplayFeature() override;
void SetDisplayFeatureForTesting(
void DisableDisplayFeatureOverrideForEmulation() override {}
void OverrideDisplayFeatureForEmulation(
const content::DisplayFeature* display_feature) override {}
void NotifyHostAndDelegateOnWasShown(
blink::mojom::RecordContentToVisibleTimeRequestPtr) final;

View file

@ -31,15 +31,15 @@
namespace electron {
gfx::NativeView OffScreenWebContentsView::GetNativeView() const {
return offScreenView_;
return gfx::NativeView(offScreenView_);
}
gfx::NativeView OffScreenWebContentsView::GetContentNativeView() const {
return offScreenView_;
return gfx::NativeView(offScreenView_);
}
gfx::NativeWindow OffScreenWebContentsView::GetTopLevelNativeWindow() const {
return [offScreenView_ window];
return gfx::NativeWindow([offScreenView_ window]);
}
void OffScreenWebContentsView::PlatformCreate() {

View file

@ -124,7 +124,8 @@ void DevToolsManagerDelegate::HandleCommand(
scoped_refptr<content::DevToolsAgentHost>
DevToolsManagerDelegate::CreateNewTarget(const GURL& url,
TargetType target_type) {
TargetType target_type,
bool new_window) {
return nullptr;
}

View file

@ -33,7 +33,8 @@ class DevToolsManagerDelegate : public content::DevToolsManagerDelegate {
NotHandledCallback callback) override;
scoped_refptr<content::DevToolsAgentHost> CreateNewTarget(
const GURL& url,
TargetType target_type) override;
TargetType target_type,
bool new_window) override;
std::string GetDiscoveryPageHTML() override;
bool HasBundledFrontendResources() override;
content::BrowserContext* GetDefaultBrowserContext() override;

View file

@ -160,8 +160,8 @@ void HandleAccessibilityRequestCallback(
static_cast<electron::ElectronBrowserContext*>(current_context)->prefs();
ui::AXMode mode =
content::BrowserAccessibilityState::GetInstance()->GetAccessibilityMode();
bool is_native_enabled = content::BrowserAccessibilityState::GetInstance()
->IsRendererAccessibilityEnabled();
bool is_a11y_allowed = content::BrowserAccessibilityState::GetInstance()
->IsAccessibilityAllowed();
bool native = mode.has_mode(ui::AXMode::kNativeAPIs);
bool web = mode.has_mode(ui::AXMode::kWebContents);
bool text = mode.has_mode(ui::AXMode::kInlineTextBoxes);
@ -171,12 +171,12 @@ void HandleAccessibilityRequestCallback(
// The "native" and "web" flags are disabled if
// --disable-renderer-accessibility is set.
data.Set(kNative, is_native_enabled ? (native ? kOn : kOff) : kDisabled);
data.Set(kWeb, is_native_enabled ? (web ? kOn : kOff) : kDisabled);
data.Set(kNative, is_a11y_allowed ? (native ? kOn : kOff) : kDisabled);
data.Set(kWeb, is_a11y_allowed ? (web ? kOn : kOff) : kDisabled);
// The "text", "extendedProperties" and "html" flags are only
// meaningful if "web" is enabled.
bool is_web_enabled = is_native_enabled && web;
bool is_web_enabled = is_a11y_allowed && web;
data.Set(kText, is_web_enabled ? (text ? kOn : kOff) : kDisabled);
data.Set(kExtendedProperties,
is_web_enabled ? (extendedProperties ? kOn : kOff) : kDisabled);
@ -245,7 +245,7 @@ void HandleAccessibilityRequestCallback(
}
base::Value::Dict descriptor = BuildTargetDescriptor(rvh);
descriptor.Set(kNative, is_native_enabled);
descriptor.Set(kNative, is_a11y_allowed);
descriptor.Set(kExtendedProperties, is_web_enabled && extendedProperties);
descriptor.Set(kWeb, is_web_enabled);
page_list.Append(std::move(descriptor));