Compare commits

..

5 Commits

Author SHA1 Message Date
Sudowoodo Release Bot
fb0bbf0100 Bump v21.0.0-beta.2 2022-09-01 06:31:01 -07:00
trop[bot]
5e8b4bd86f fix: crash when switching origins with emulation settings set (#35488)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-31 11:20:10 +09:00
Sudowoodo Release Bot
da47103ad7 Bump v21.0.0-beta.1 2022-08-30 10:11:56 -07:00
trop[bot]
7b62386296 fix: crash on WebWorker destruction (#35492)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-30 13:58:28 +02:00
trop[bot]
018bc0993e chore: use nghttp2's config.h on all platforms (#35487)
https://github.com/nodejs/node/pull/27283

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-08-30 10:57:32 +02:00
9 changed files with 90 additions and 12 deletions

View File

@@ -1 +1 @@
21.0.0-alpha.6
21.0.0-beta.2

View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "21.0.0-alpha.6",
"version": "21.0.0-beta.2",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {

View File

@@ -117,3 +117,4 @@ add_maximized_parameter_to_linuxui_getwindowframeprovider.patch
revert_spellcheck_fully_launch_spell_check_delayed_initialization.patch
add_electron_deps_to_license_credits_file.patch
feat_add_set_can_resize_mutator.patch
fix_revert_emulationhandler_update_functions_to_early_return.patch

View File

@@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Fri, 26 Aug 2022 11:24:27 +0200
Subject: fix: revert EmulationHandler update functions to early return
Our debugger class (a subclass of ontent::DevToolsAgentHostClient) isn't
aware of those changes unless we hook RenderFrameHostChanged. If we
don't do this, some navigation lifecycle events
{loadingFinished, dataReceived} emitted by the renderer are lost. We
disconnect and reconnect the webcontents to the DevToolsAgentHost to
prevent this from happening.
As of https://chromium-review.googlesource.com/c/chromium/src/+/3758294
this results in a DCHECK, since DevToolsAgentHost::DisconnectWebContents
results in a call to UpdateDeviceEmulationState and host_ is nullptr. To
fix this, we revert those state update calls to early returns.
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856525
diff --git a/content/browser/devtools/protocol/emulation_handler.cc b/content/browser/devtools/protocol/emulation_handler.cc
index 84736afeb21d1deec0f4032ef6f3304075d8fffb..d023bb7b5a34c5c055d3d7cc5dc3e04ef43bcc3b 100644
--- a/content/browser/devtools/protocol/emulation_handler.cc
+++ b/content/browser/devtools/protocol/emulation_handler.cc
@@ -565,7 +565,9 @@ WebContentsImpl* EmulationHandler::GetWebContents() {
}
void EmulationHandler::UpdateTouchEventEmulationState() {
- DCHECK(host_);
+ if (!host_)
+ return;
+
// We only have a single TouchEmulator for all frames, so let the main frame's
// EmulationHandler enable/disable it.
DCHECK(!host_->GetParentOrOuterDocument());
@@ -585,7 +587,9 @@ void EmulationHandler::UpdateTouchEventEmulationState() {
}
void EmulationHandler::UpdateDeviceEmulationState() {
- DCHECK(host_);
+ if (!host_)
+ return;
+
// Device emulation only happens on the outermost main frame.
DCHECK(!host_->GetParentOrOuterDocument());

View File

@@ -672,10 +672,10 @@ index 0000000000000000000000000000000000000000..fb000f8ee7647c375bc190d1729d67bb
+}
diff --git a/deps/nghttp2/BUILD.gn b/deps/nghttp2/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..8bfecba74d4d90e9fbf0e2cd301118e4adc6cba8
index 0000000000000000000000000000000000000000..9abde472d88923db835b12982b7f2ccb1f260196
--- /dev/null
+++ b/deps/nghttp2/BUILD.gn
@@ -0,0 +1,49 @@
@@ -0,0 +1,47 @@
+config("nghttp2_config") {
+ defines = [ "NGHTTP2_STATICLIB" ]
+ include_dirs = [ "lib/includes" ]
@@ -686,11 +686,9 @@ index 0000000000000000000000000000000000000000..8bfecba74d4d90e9fbf0e2cd301118e4
+ "_U_",
+ "BUILDING_NGHTTP2",
+ "NGHTTP2_STATICLIB",
+ "HAVE_CONFIG_H",
+ ]
+ include_dirs = [ "lib/includes" ]
+ if (is_win) {
+ defines += [ "HAVE_CONFIG_H" ]
+ }
+
+ cflags_c = [
+ "-Wno-implicit-function-declaration",

View File

@@ -136,7 +136,7 @@ index 7cd3a2a954ff7d70e6ba7a6f7538648841bc54b2..f89b7158218be60ac10e61484a2d5e5e
diff --git a/deps/uv/src/unix/loop.c b/deps/uv/src/unix/loop.c
index a88e71c339351f2ebcdd6c3f933fc3b1122910ed..353143e5ebecae598425dc036f4458bb7c43bb0b 100644
index a88e71c339351f2ebcdd6c3f933fc3b1122910ed..46fc03264b6cc1a3a4d8faf5ec5a754fc07c9b6d 100644
--- a/deps/uv/src/unix/loop.c
+++ b/deps/uv/src/unix/loop.c
@@ -217,6 +217,11 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) {
@@ -151,7 +151,7 @@ index a88e71c339351f2ebcdd6c3f933fc3b1122910ed..353143e5ebecae598425dc036f4458bb
if (option != UV_LOOP_BLOCK_SIGNAL)
return UV_ENOSYS;
@@ -226,3 +231,37 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) {
@@ -226,3 +231,40 @@ int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) {
loop->flags |= UV_LOOP_BLOCK_SIGPROF;
return 0;
}
@@ -183,6 +183,9 @@ index a88e71c339351f2ebcdd6c3f933fc3b1122910ed..353143e5ebecae598425dc036f4458bb
+ if (r == len)
+ return;
+
+ if (!uv_loop_alive(loop))
+ return;
+
+ if (r == -1)
+ if (errno == EAGAIN || errno == EWOULDBLOCK)
+ return;

View File

@@ -50,8 +50,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 21,0,0,6
PRODUCTVERSION 21,0,0,6
FILEVERSION 21,0,0,2
PRODUCTVERSION 21,0,0,2
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L

View File

@@ -37,6 +37,7 @@
#include "shell/common/mac/main_application_bundle.h"
#include "shell/common/node_includes.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_initializer.h" // nogncheck
#include "third_party/electron_node/src/debug_utils.h"
#if !defined(MAS_BUILD)
#include "shell/common/crash_keys.h"
@@ -136,7 +137,7 @@ void stop_and_close_uv_loop(uv_loop_t* loop) {
break;
DCHECK_EQ(0, uv_loop_alive(loop));
uv_loop_close(loop);
node::CheckedUvLoopClose(loop);
}
bool g_is_initialized = false;

View File

@@ -326,6 +326,7 @@ describe('webContents module', () => {
describe('loadURL() promise API', () => {
let w: BrowserWindow;
beforeEach(async () => {
w = new BrowserWindow({ show: false });
});
@@ -357,6 +358,35 @@ describe('webContents module', () => {
.and.have.property('code', 'ERR_FAILED');
});
it('does not crash when loading a new URL with emulation settings set', async () => {
const setEmulation = async () => {
if (w.webContents) {
w.webContents.debugger.attach('1.3');
const deviceMetrics = {
width: 700,
height: 600,
deviceScaleFactor: 2,
mobile: true,
dontSetVisibleSize: true
};
await w.webContents.debugger.sendCommand(
'Emulation.setDeviceMetricsOverride',
deviceMetrics
);
}
};
try {
await w.loadURL(`file://${fixturesPath}/pages/blank.html`);
await setEmulation();
await w.loadURL('data:text/html,<h1>HELLO</h1>');
await setEmulation();
} catch (e) {
expect((e as Error).message).to.match(/Debugger is already attached to the target/);
}
});
it('sets appropriate error information on rejection', async () => {
let err: any;
try {