GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — build: stop including simdjson.h from env.h and use forward frame moj… · electron/electron@6aef25c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • patches
    • chromium
      • can_create_window.patch
    • node
      • .patches
      • src_stop_including_simdjson_h_from_env_h.patch
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎patches/chromium/can_create_window.patch‎

Copy file name to clipboardExpand all lines: patches/chromium/can_create_window.patch
+12-4Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,18 @@ index 42a04c54b65ddcf0905c7d527de950303bcf8ab7..ce53f4dab5f793d58a560573680edb39
128128
bool opener_suppressed,
129129
bool* no_javascript_access);
130130
diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
131-
index 03560c05649a87a87ab514052d302b38799e9a57..2e87b1a0eb238e97d18b8871782ea8e222bbfe0a 100644
131+
index 03560c05649a87a87ab514052d302b38799e9a57..9da320927b69ee61a665063d95fa3cd8a626225f 100644
132132
--- a/content/public/browser/web_contents_delegate.cc
133133
+++ b/content/public/browser/web_contents_delegate.cc
134-
@@ -35,6 +35,18 @@ namespace content {
134+
@@ -12,6 +12,7 @@
135+
#include "base/memory/singleton.h"
136+
#include "base/notreached.h"
137+
#include "build/build_config.h"
138+
+#include "content/common/frame.mojom.h"
139+
#include "content/public/browser/audio_stream_broker.h"
140+
#include "content/public/browser/color_chooser.h"
141+
#include "content/public/browser/file_select_listener.h"
142+
@@ -35,6 +36,18 @@ namespace content {
135143

136144
WebContentsDelegate::WebContentsDelegate() = default;
137145

@@ -151,14 +159,14 @@ index 03560c05649a87a87ab514052d302b38799e9a57..2e87b1a0eb238e97d18b8871782ea8e2
151159
WebContents* source,
152160
const OpenURLParams& params,
153161
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
154-
index 38efabfe5d486e893fbf4f4fed72570771dad817..33070d7de072e48b305067429b29541861868269 100644
162+
index 38efabfe5d486e893fbf4f4fed72570771dad817..86977e5ffc531cf919fa3addb600d3cb7d91ab77 100644
155163
--- a/content/public/browser/web_contents_delegate.h
156164
+++ b/content/public/browser/web_contents_delegate.h
157165
@@ -19,6 +19,7 @@
158166
#include "base/types/expected.h"
159167
#include "build/build_config.h"
160168
#include "content/common/content_export.h"
161-
+#include "content/common/frame.mojom.h"
169+
+#include "content/common/frame.mojom-forward.h"
162170
#include "content/public/browser/eye_dropper.h"
163171
#include "content/public/browser/fullscreen_types.h"
164172
#include "content/public/browser/immersive_playback_options.h"
Collapse file

‎patches/node/.patches‎

Copy file name to clipboardExpand all lines: patches/node/.patches
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ test_drop_removed_wasm_rab_integration_flag.patch
5252
test_skip_rmsync_permission_error_test_when_running_as_root.patch
5353
test_skip_openssl_config_test_under_boringssl.patch
5454
tls_reject_chains_containing_blocked_public_keys.patch
55+
src_stop_including_simdjson_h_from_env_h.patch
Collapse file

‎patches/node/src_stop_including_simdjson_h_from_env_h.patch‎

Copy file name to clipboard
+246Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Daniel Lemire <[email protected]>
3+
Date: Tue, 6 Oct 2026 17:11:53 -0400
4+
Subject: src: stop including simdjson.h from env.h
5+
6+
Backport of https://github.com/nodejs/node/pull/66620 (upstream commit
7+
https://github.com/nodejs/node/commit/2b17b43eeba4484d43afaa1d5e3f951f006c5df6).
8+
Only the include-reduction commit is taken; the simdjson 5.0.3 update
9+
from the same PR is not.
10+
11+
env.h includes inspector_profiler.h, which included simdjson.h for
12+
the types of two virtual methods and a parser member. As a result,
13+
about 155 files in src/ parsed the amalgamated simdjson header, which
14+
is over 10 MB.
15+
16+
Keep simdjson out of inspector_profiler.h: the profile connections
17+
now say which field of `result` holds the profile, and
18+
WriteProfile() takes the profile as raw JSON. The parser becomes a
19+
local variable, so its buffers are no longer kept alive for the
20+
lifetime of the Environment. Also drop the unused include from
21+
node_task_runner.h.
22+
23+
The upstream change to src/node_config_file.cc is omitted: it removes
24+
a second parse of the config file that does not exist on v24.x.
25+
26+
This patch can be removed when Electron updates to a Node.js release
27+
that contains nodejs/node#66620.
28+
29+
diff --git a/src/inspector_profiler.cc b/src/inspector_profiler.cc
30+
index 559b4fd27d56abed0a9aaa7981e10fe12ebb0c2a..791ff993f84dcb2ee2bf85758e44362a5c23312e 100644
31+
--- a/src/inspector_profiler.cc
32+
+++ b/src/inspector_profiler.cc
33+
@@ -13,7 +13,9 @@
34+
35+
#include <cinttypes>
36+
#include <limits>
37+
+#include <optional>
38+
#include <sstream>
39+
+#include "simdjson.h"
40+
#include "simdutf.h"
41+
42+
namespace node {
43+
@@ -109,6 +111,28 @@ bool StringViewToUTF8(const v8_inspector::StringView& source,
44+
return *utf8_length == result_len;
45+
}
46+
47+
+// Return the raw JSON of the profile object in `result`: either the
48+
+// `field` member of `result` or, if `field` is nullptr, `result` itself.
49+
+static std::optional<std::string_view> GetProfile(
50+
+ simdjson::ondemand::object* result, const char* field, const char* type) {
51+
+ simdjson::ondemand::object profile_object;
52+
+ if (field == nullptr) {
53+
+ profile_object = *result;
54+
+ } else if ((*result)[field].get_object().get(profile_object)) {
55+
+ fprintf(
56+
+ stderr, "'%s' from %s profile result is not an Object\n", field, type);
57+
+ return std::nullopt;
58+
+ }
59+
+ std::string_view profile_raw;
60+
+ if (profile_object.raw_json().get(profile_raw)) {
61+
+ fprintf(stderr,
62+
+ "Cannot get raw string of the 'profile' field from %s profile\n",
63+
+ type);
64+
+ return std::nullopt;
65+
+ }
66+
+ return profile_raw;
67+
+}
68+
+
69+
void V8ProfilerConnection::V8ProfilerSessionDelegate::SendMessageToFrontend(
70+
const v8_inspector::StringView& message) {
71+
Environment* env = connection_->env();
72+
@@ -134,9 +158,10 @@ void V8ProfilerConnection::V8ProfilerSessionDelegate::SendMessageToFrontend(
73+
return;
74+
}
75+
76+
+ simdjson::ondemand::parser json_parser;
77+
simdjson::ondemand::document parsed;
78+
simdjson::ondemand::object response;
79+
- if (connection_->json_parser_
80+
+ if (json_parser
81+
.iterate(
82+
message_utf8.data(), message_utf8_length, message_utf8.size())
83+
.get(parsed) ||
84+
@@ -184,7 +209,10 @@ void V8ProfilerConnection::V8ProfilerSessionDelegate::SendMessageToFrontend(
85+
return;
86+
}
87+
88+
- connection_->WriteProfile(&result);
89+
+ auto profile = GetProfile(&result, connection_->profile_field(), type);
90+
+ if (profile.has_value()) {
91+
+ connection_->WriteProfile(*profile);
92+
+ }
93+
connection_->RemoveProfileId(id);
94+
}
95+
96+
@@ -214,32 +242,7 @@ std::string V8CoverageConnection::GetFilename() const {
97+
env()->thread_id());
98+
}
99+
100+
-std::optional<std::string_view> V8ProfilerConnection::GetProfile(
101+
- simdjson::ondemand::object* result) {
102+
- simdjson::ondemand::object profile_object;
103+
- if ((*result)["profile"].get_object().get(profile_object)) {
104+
- fprintf(
105+
- stderr, "'profile' from %s profile result is not an Object\n", type());
106+
- return std::nullopt;
107+
- }
108+
- std::string_view profile_raw;
109+
- if (profile_object.raw_json().get(profile_raw)) {
110+
- fprintf(stderr,
111+
- "Cannot get raw string of the 'profile' field from %s profile\n",
112+
- type());
113+
- return std::nullopt;
114+
- }
115+
- return profile_raw;
116+
-}
117+
-
118+
-void V8ProfilerConnection::WriteProfile(simdjson::ondemand::object* result) {
119+
- // Generate the profile output from the subclass.
120+
- auto profile_opt = GetProfile(result);
121+
- if (!profile_opt.has_value()) {
122+
- return;
123+
- }
124+
- std::string_view profile = profile_opt.value();
125+
-
126+
+void V8ProfilerConnection::WriteProfile(std::string_view profile) {
127+
// Create the directory if necessary.
128+
std::string directory = GetDirectory();
129+
DCHECK(!directory.empty());
130+
@@ -254,7 +257,7 @@ void V8ProfilerConnection::WriteProfile(simdjson::ondemand::object* result) {
131+
WriteResult(env_, path.c_str(), profile);
132+
}
133+
134+
-void V8CoverageConnection::WriteProfile(simdjson::ondemand::object* result) {
135+
+void V8CoverageConnection::WriteProfile(std::string_view profile) {
136+
Isolate* isolate = env_->isolate();
137+
HandleScope handle_scope(isolate);
138+
139+
@@ -271,13 +274,6 @@ void V8CoverageConnection::WriteProfile(simdjson::ondemand::object* result) {
140+
Local<Context> context = env_->context();
141+
Context::Scope context_scope(context);
142+
143+
- // Generate the profile output from the subclass.
144+
- auto profile_opt = GetProfile(result);
145+
- if (!profile_opt.has_value()) {
146+
- return;
147+
- }
148+
- std::string_view profile = profile_opt.value();
149+
-
150+
// append source-map cache information to coverage object:
151+
Local<Value> source_map_cache_v;
152+
{
153+
@@ -349,18 +345,6 @@ void V8CoverageConnection::WriteProfile(simdjson::ondemand::object* result) {
154+
}
155+
}
156+
157+
-std::optional<std::string_view> V8CoverageConnection::GetProfile(
158+
- simdjson::ondemand::object* result) {
159+
- std::string_view profile_raw;
160+
- if (result->raw_json().get(profile_raw)) {
161+
- fprintf(stderr,
162+
- "Cannot get raw string of the 'profile' field from %s profile\n",
163+
- type());
164+
- return std::nullopt;
165+
- }
166+
- return profile_raw;
167+
-}
168+
-
169+
std::string V8CoverageConnection::GetDirectory() const {
170+
return env()->coverage_directory();
171+
}
172+
diff --git a/src/inspector_profiler.h b/src/inspector_profiler.h
173+
index d07334c818d90ec32594e5776b87232744425246..cdd6bcf6f0aa0bcbc77b916a827afa35c3b59ea2 100644
174+
--- a/src/inspector_profiler.h
175+
+++ b/src/inspector_profiler.h
176+
@@ -7,10 +7,9 @@
177+
#error("This header can only be used when inspector is enabled")
178+
#endif
179+
180+
-#include <optional>
181+
+#include <string_view>
182+
#include <unordered_set>
183+
#include "inspector_agent.h"
184+
-#include "simdjson.h"
185+
186+
namespace node {
187+
// Forward declaration to break recursive dependency chain with src/env.h.
188+
@@ -59,11 +58,11 @@ class V8ProfilerConnection {
189+
virtual std::string GetDirectory() const = 0;
190+
// Return the filename the profile should be written as.
191+
virtual std::string GetFilename() const = 0;
192+
- // Return the profile object parsed from `message.result`,
193+
- // which will be then written as a JSON.
194+
- virtual std::optional<std::string_view> GetProfile(
195+
- simdjson::ondemand::object* result);
196+
- virtual void WriteProfile(simdjson::ondemand::object* result);
197+
+ // Return the field of `message.result` that holds the profile object,
198+
+ // or nullptr if `message.result` is itself the profile object.
199+
+ virtual const char* profile_field() const { return "profile"; }
200+
+ // Write the profile, given as raw JSON.
201+
+ virtual void WriteProfile(std::string_view profile);
202+
203+
bool HasProfileId(uint64_t id) const { return profile_ids_.contains(id); }
204+
205+
@@ -76,7 +75,6 @@ class V8ProfilerConnection {
206+
std::unordered_set<uint64_t> profile_ids_;
207+
208+
protected:
209+
- simdjson::ondemand::parser json_parser_;
210+
Environment* env_ = nullptr;
211+
};
212+
213+
@@ -92,9 +90,8 @@ class V8CoverageConnection : public V8ProfilerConnection {
214+
215+
std::string GetDirectory() const override;
216+
std::string GetFilename() const override;
217+
- std::optional<std::string_view> GetProfile(
218+
- simdjson::ondemand::object* result) override;
219+
- void WriteProfile(simdjson::ondemand::object* result) override;
220+
+ const char* profile_field() const override { return nullptr; }
221+
+ void WriteProfile(std::string_view profile) override;
222+
void WriteSourceMapCache();
223+
void TakeCoverage();
224+
void StopCoverage();
225+
diff --git a/src/node_task_runner.cc b/src/node_task_runner.cc
226+
index 55f348afc69ae3244bca41901c94cb0ad0263a97..136dec24fa023fdd32150401be38194a80116910 100644
227+
--- a/src/node_task_runner.cc
228+
+++ b/src/node_task_runner.cc
229+
@@ -1,4 +1,5 @@
230+
#include "node_task_runner.h"
231+
+#include "simdjson.h"
232+
#include "util-inl.h"
233+
234+
#include <regex> // NOLINT(build/c++11)
235+
diff --git a/src/node_task_runner.h b/src/node_task_runner.h
236+
index 15573498f7393a04302237dd42e265bba73141b3..8cdfe572353395567465e29b0e63b8919e2608d1 100644
237+
--- a/src/node_task_runner.h
238+
+++ b/src/node_task_runner.h
239+
@@ -4,7 +4,6 @@
240+
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
241+
242+
#include "node_internals.h"
243+
-#include "simdjson.h"
244+
#include "spawn_sync.h"
245+
#include "uv.h"
246+

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.