chore: bump chromium to 133.0.6920.0 (main) (#45055)

* chore: bump chromium in DEPS to 133.0.6902.0

* chore: bump chromium in DEPS to 133.0.6903.0

* chore: update patches

* Update PdfViewer Save File Picker to use showSaveFilePicker.

Refs 6074308

* Code Health: Clean up stale MacWebContentsOcclusion

Refs 6078344

* Change RenderProcessHost::GetID to RenderProcessHost::GetDeprecatedID

Refs 6065543

* [WebRTC] Make WebRTC IP Handling policy a mojo enum

Refs 6063620

* chore: gen filenames.libcxx.gni

* Remove allow_unsafe_buffers pragma in //printing

Refs 6092280

* refactor: to use ChildProcessId where possible

Refs https://issues.chromium.org/issues/379869738

* [Win] Update TabletMode detection code

Refs 6003486

* chore: bump chromium in DEPS to 133.0.6905.0

* chore: update patches

* Reland "Move global shortcut listener to //ui/base"

Refs 6099035

* [shared storage] Implement the batch `with_lock` option for response header

Refs 6072742

* chore: bump chromium in DEPS to 133.0.6907.0

* chore: bump chromium in DEPS to 133.0.6909.0

* chore: bump chromium in DEPS to 133.0.6911.0

* chore: bump chromium in DEPS to 133.0.6912.0

* chore: update patches

* WebUI: Reveal hidden deps to ui/webui/resources.

Refs 6096291

* chore: bump chromium in DEPS to 133.0.6913.0

* chore: bump chromium in DEPS to 133.0.6915.0

* Code Health: Clean up stale base::Feature "AccessibilityTreeForViews"

Refs 6104174

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* fix: remove fastapitypedarray usage

* chore: update patches

* chore: script/gen-libc++-filenames.js

* Code Health: Clean up stale base::Feature "WinRetrieveSuggestionsOnlyOnDemand"

Refs 6109477

* fix: empty suggestions with windows platform checker

Amends the fix from https://github.com/electron/electron/pull/29690
since the feature flag is no longer available. We follow the
same pattern as //chrome/browser/renderer_context_menu/spelling_menu_observer.cc
to generate the suggestion list on demand when context menu action
is invoked.

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* fixup! fix: empty suggestions with windows platform checker

* fixup! fix: empty suggestions with windows platform checker

* revert: 6078344: Code Health: Clean up stale MacWebContentsOcclusion | 6078344

* Revert "revert: 6078344: Code Health: Clean up stale MacWebContentsOcclusion | 6078344"

This reverts commit 9cacda452ed5a072351e8f5a35b009d91843a08c.

* chore: bump to 133.0.6920.0, update patches

* Revert "6078344: Code Health: Clean up stale MacWebContentsOcclusion"

Refs: 6078344

* fixup! Update PdfViewer Save File Picker to use showSaveFilePicker.

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
This commit is contained in:
electron-roller[bot] 2025-01-10 10:52:34 -06:00 committed by GitHub
parent 062d14e553
commit 7d05b78479
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
120 changed files with 1167 additions and 2629 deletions

View file

@ -46,3 +46,4 @@ src_provide_workaround_for_container-overflow.patch
build_allow_unbundling_of_node_js_dependencies.patch
test_use_static_method_names_in_call_stacks.patch
build_use_third_party_simdutf.patch
fix_remove_fastapitypedarray_usage.patch

View file

@ -0,0 +1,277 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Sun, 29 Dec 2024 04:01:32 +0900
Subject: fix: remove FastApiTypedArray usage
Refs https://github.com/electron/electron/pull/45055#issuecomment-2559095439
Can be removed when upstream adopts relevant V8 version.
diff --git a/src/crypto/crypto_timing.cc b/src/crypto/crypto_timing.cc
index 867a1c4aca54b9d41490d23a5eb55088b7e941cc..09f4c65a18efea262b1f854f993c6f18273f48f5 100644
--- a/src/crypto/crypto_timing.cc
+++ b/src/crypto/crypto_timing.cc
@@ -11,7 +11,6 @@
namespace node {
using v8::FastApiCallbackOptions;
-using v8::FastApiTypedArray;
using v8::FunctionCallbackInfo;
using v8::Local;
using v8::Object;
@@ -50,14 +49,13 @@ void TimingSafeEqual(const FunctionCallbackInfo<Value>& args) {
}
bool FastTimingSafeEqual(Local<Value> receiver,
- const FastApiTypedArray<uint8_t>& a,
- const FastApiTypedArray<uint8_t>& b,
+ Local<Value> a,
+ Local<Value> b,
// NOLINTNEXTLINE(runtime/references)
FastApiCallbackOptions& options) {
- uint8_t* data_a;
- uint8_t* data_b;
- if (a.length() != b.length() || !a.getStorageIfAligned(&data_a) ||
- !b.getStorageIfAligned(&data_b)) {
+ FAST_SPREAD_BUFFER_ARG(a, a_buffer);
+ FAST_SPREAD_BUFFER_ARG(b, b_buffer);
+ if (a_buffer_length != b_buffer_length) {
TRACK_V8_FAST_API_CALL("crypto.timingSafeEqual.error");
v8::HandleScope scope(options.isolate);
THROW_ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH(options.isolate);
@@ -65,7 +63,7 @@ bool FastTimingSafeEqual(Local<Value> receiver,
}
TRACK_V8_FAST_API_CALL("crypto.timingSafeEqual.ok");
- return CRYPTO_memcmp(data_a, data_b, a.length()) == 0;
+ return CRYPTO_memcmp(a_buffer_data, b_buffer_data, a_buffer_length) == 0;
}
static v8::CFunction fast_equal(v8::CFunction::Make(FastTimingSafeEqual));
diff --git a/src/node_buffer.cc b/src/node_buffer.cc
index 2302e8d94da3250e7fb4ee0c5e6a51d3d6941fbc..ed72476e16036d972de54d39cf4bd37bbbed5c5f 100644
--- a/src/node_buffer.cc
+++ b/src/node_buffer.cc
@@ -44,6 +44,14 @@
#define THROW_AND_RETURN_UNLESS_BUFFER(env, obj) \
THROW_AND_RETURN_IF_NOT_BUFFER(env, obj, "argument") \
+#define THROW_AND_RETURN_VAL_UNLESS_BUFFER(isolate, val, prefix, retval) \
+ do { \
+ if (!Buffer::HasInstance(val)) { \
+ node::THROW_ERR_INVALID_ARG_TYPE(isolate, prefix " must be a buffer"); \
+ return retval; \
+ } \
+ } while (0)
+
#define THROW_AND_RETURN_IF_OOB(r) \
do { \
Maybe<bool> m = (r); \
@@ -60,7 +68,6 @@ using v8::ArrayBufferView;
using v8::BackingStore;
using v8::Context;
using v8::EscapableHandleScope;
-using v8::FastApiTypedArray;
using v8::FunctionCallbackInfo;
using v8::Global;
using v8::HandleScope;
@@ -581,19 +588,24 @@ void SlowCopy(const FunctionCallbackInfo<Value>& args) {
// Assume caller has properly validated args.
uint32_t FastCopy(Local<Value> receiver,
- const v8::FastApiTypedArray<uint8_t>& source,
- const v8::FastApiTypedArray<uint8_t>& target,
+ Local<Value> source_obj,
+ Local<Value> target_obj,
uint32_t target_start,
uint32_t source_start,
- uint32_t to_copy) {
- uint8_t* source_data;
- CHECK(source.getStorageIfAligned(&source_data));
-
+ uint32_t to_copy,
+ v8::FastApiCallbackOptions& options) {
+ FAST_SPREAD_BUFFER_ARG(source_obj, source);
uint8_t* target_data;
- CHECK(target.getStorageIfAligned(&target_data));
+ FAST_SPREAD_BUFFER_ARG(target_obj, target_buffer);
+ if (target_buffer_length <= kMaxSizeInHeap) {
+ HandleScope handle_scope(options.isolate);
+ SPREAD_BUFFER_ARG(target_obj, target_buffer);
+ target_data = reinterpret_cast<uint8_t*>(target_buffer_data);
+ } else {
+ target_data = target_buffer_data;
+ }
memmove(target_data + target_start, source_data + source_start, to_copy);
-
return to_copy;
}
@@ -857,19 +869,17 @@ void Compare(const FunctionCallbackInfo<Value> &args) {
}
int32_t FastCompare(v8::Local<v8::Value>,
- const FastApiTypedArray<uint8_t>& a,
- const FastApiTypedArray<uint8_t>& b) {
- uint8_t* data_a;
- uint8_t* data_b;
- CHECK(a.getStorageIfAligned(&data_a));
- CHECK(b.getStorageIfAligned(&data_b));
+ v8::Local<v8::Value> a,
+ v8::Local<v8::Value> b) {
+ FAST_SPREAD_BUFFER_ARG(a, a_buffer);
+ FAST_SPREAD_BUFFER_ARG(b, b_buffer);
- size_t cmp_length = std::min(a.length(), b.length());
+ size_t cmp_length = std::min(a_buffer_length, b_buffer_length);
return normalizeCompareVal(
- cmp_length > 0 ? memcmp(data_a, data_b, cmp_length) : 0,
- a.length(),
- b.length());
+ cmp_length > 0 ? memcmp(a_buffer_data, b_buffer_data, cmp_length) : 0,
+ a_buffer_length,
+ b_buffer_length);
}
static v8::CFunction fast_compare(v8::CFunction::Make(FastCompare));
@@ -1140,14 +1150,13 @@ void SlowIndexOfNumber(const FunctionCallbackInfo<Value>& args) {
}
int32_t FastIndexOfNumber(v8::Local<v8::Value>,
- const FastApiTypedArray<uint8_t>& buffer,
+ v8::Local<v8::Value> source_obj,
uint32_t needle,
int64_t offset_i64,
bool is_forward) {
- uint8_t* buffer_data;
- CHECK(buffer.getStorageIfAligned(&buffer_data));
+ FAST_SPREAD_BUFFER_ARG(source_obj, buffer);
return IndexOfNumber(
- buffer_data, buffer.length(), needle, offset_i64, is_forward);
+ buffer_data, buffer_length, needle, offset_i64, is_forward);
}
static v8::CFunction fast_index_of_number(
@@ -1552,21 +1561,31 @@ void SlowWriteString(const FunctionCallbackInfo<Value>& args) {
template <encoding encoding>
uint32_t FastWriteString(Local<Value> receiver,
- const v8::FastApiTypedArray<uint8_t>& dst,
+ Local<v8::Value> dst,
const v8::FastOneByteString& src,
uint32_t offset,
- uint32_t max_length) {
- uint8_t* dst_data;
- CHECK(dst.getStorageIfAligned(&dst_data));
- CHECK(offset <= dst.length());
- CHECK(dst.length() - offset <= std::numeric_limits<uint32_t>::max());
+ uint32_t max_length,
+ v8::FastApiCallbackOptions& options) {
+ THROW_AND_RETURN_VAL_UNLESS_BUFFER(options.isolate, dst, "dst", 0);
+ uint8_t* dst_buffer_data;
+ FAST_SPREAD_BUFFER_ARG(dst, dst_fast_buffer);
+ if (dst_fast_buffer_length <= kMaxSizeInHeap) {
+ HandleScope handle_scope(options.isolate);
+ SPREAD_BUFFER_ARG(dst, dst_slow_buffer);
+ dst_buffer_data = reinterpret_cast<uint8_t*>(dst_slow_buffer_data);
+ } else {
+ dst_buffer_data = dst_fast_buffer_data;
+ };
+
+ CHECK(dst_fast_buffer_length <= std::numeric_limits<uint32_t>::max());
+ uint32_t dst_size = static_cast<uint32_t>(dst_fast_buffer_length);
TRACK_V8_FAST_API_CALL("buffer.writeString");
return WriteOneByteString<encoding>(
src.data,
src.length,
- reinterpret_cast<char*>(dst_data + offset),
- std::min<uint32_t>(dst.length() - offset, max_length));
+ reinterpret_cast<char*>(dst_buffer_data + offset),
+ std::min<uint32_t>(dst_size - offset, max_length));
}
static v8::CFunction fast_write_string_ascii(
diff --git a/src/node_external_reference.h b/src/node_external_reference.h
index 38a4ff7e6c2c9997f004c7c1f94cb5a9ffc2ffe0..48e73168f994d79ae3564b813acb5546ca8f2526 100644
--- a/src/node_external_reference.h
+++ b/src/node_external_reference.h
@@ -34,16 +34,16 @@ using CFunctionCallbackWithStrings =
const v8::FastOneByteString& base);
using CFunctionCallbackWithTwoUint8Arrays =
int32_t (*)(v8::Local<v8::Value>,
- const v8::FastApiTypedArray<uint8_t>&,
- const v8::FastApiTypedArray<uint8_t>&);
+ v8::Local<v8::Value>,
+ v8::Local<v8::Value>);
using CFunctionCallbackWithTwoUint8ArraysFallback =
bool (*)(v8::Local<v8::Value>,
- const v8::FastApiTypedArray<uint8_t>&,
- const v8::FastApiTypedArray<uint8_t>&,
+ v8::Local<v8::Value>,
+ v8::Local<v8::Value>,
v8::FastApiCallbackOptions&);
using CFunctionCallbackWithUint8ArrayUint32Int64Bool =
int32_t (*)(v8::Local<v8::Value>,
- const v8::FastApiTypedArray<uint8_t>&,
+ v8::Local<v8::Value>,
uint32_t,
int64_t,
bool);
@@ -58,18 +58,20 @@ using CFunctionWithBool = void (*)(v8::Local<v8::Value>, bool);
using CFunctionWriteString =
uint32_t (*)(v8::Local<v8::Value> receiver,
- const v8::FastApiTypedArray<uint8_t>& dst,
+ v8::Local<v8::Value> dst,
const v8::FastOneByteString& src,
uint32_t offset,
- uint32_t max_length);
+ uint32_t max_length,
+ v8::FastApiCallbackOptions&);
using CFunctionBufferCopy =
uint32_t (*)(v8::Local<v8::Value> receiver,
- const v8::FastApiTypedArray<uint8_t>& source,
- const v8::FastApiTypedArray<uint8_t>& target,
+ v8::Local<v8::Value> source,
+ v8::Local<v8::Value> target,
uint32_t target_start,
uint32_t source_start,
- uint32_t to_copy);
+ uint32_t to_copy,
+ v8::FastApiCallbackOptions&);
// This class manages the external references from the V8 heap
// to the C++ addresses in Node.js.
diff --git a/src/util.h b/src/util.h
index a6da8720c499df54ab4608eb03cff905759c2232..43ef977363e565a6f9422c9454e25b8fe0b327d5 100644
--- a/src/util.h
+++ b/src/util.h
@@ -57,6 +57,8 @@
namespace node {
+static constexpr size_t kMaxSizeInHeap = 64; \
+
#ifdef _WIN32
/* MAX_PATH is in characters, not bytes. Make sure we have enough headroom. */
#define PATH_MAX_BYTES (MAX_PATH * 4)
@@ -573,6 +575,16 @@ class BufferValue : public MaybeStackBuffer<char> {
static_cast<char*>(name->Buffer()->Data()) + name##_offset; \
if (name##_length > 0) CHECK_NE(name##_data, nullptr);
+#define FAST_SPREAD_BUFFER_ARG(val, name) \
+ CHECK((val)->IsArrayBufferView()); \
+ v8::Local<v8::ArrayBufferView> name = (val).As<v8::ArrayBufferView>(); \
+ uint8_t name##_buffer[kMaxSizeInHeap]; \
+ v8::MemorySpan<uint8_t> name##_storage(name##_buffer); \
+ name##_storage = name->GetContents(name##_storage); \
+ const size_t name##_length = name##_storage.size(); \
+ uint8_t* name##_data = name##_storage.data(); \
+ if (name##_length > 0) CHECK_NE(name##_data, nullptr);
+
// Use this when a variable or parameter is unused in order to explicitly
// silence a compiler warning about that.
template <typename T> inline void USE(T&&) {}