electron/shell/common
trop[bot] ab71a179ec
perf: have ErrorThrower lazily lookup the current isolate (#46416)
perf: have ErrorThrower lazy-lookup the current isolate

ErrorThrower's default constructor is marked as "should rarely if ever
be used" because it's expensive to call.

Unfortunately, nearly every instance of ErrorThrower comes as an argument
in gin_helper's JS-->C++ function marshalling where a thrower is
default-constructed and then populated in gin_helper::GetNextArgument()
with an assignment operator to a temporary ErrorThrower constructed
with the gin::Arguments' isolate.

tldr: most of the time we use the slow constructor first, then throw
that work away unused by overwriting with a fast-constructed one.

This refactor avoids that cost by deferring the expensive work to
`ErrorThrower::isolate()`, where it happens only as a fallback iff
isolate_ hasn't been set.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-04-01 15:29:42 -05:00
..
api refactor: use C++20's contains() method (#45814) 2025-02-27 10:38:30 +01:00
asar fix: modernize-use-using clang-tidy warnings (#44835) 2024-11-25 13:53:59 -05:00
extensions fix: chrome.i18n unavailable in extension service workers (#45036) 2024-12-16 13:14:32 -05:00
gin_converters refactor: use v8::String::Empty() when creating empty strings (#46370) 2025-03-31 09:26:46 -05:00
gin_helper perf: have ErrorThrower lazily lookup the current isolate (#46416) 2025-04-01 15:29:42 -05:00
mac refactor: return-braced-init-list pt 2 of 2 (#44891) 2024-11-30 16:47:30 -06:00
resources/mac fix: disable MallocNanoZone on mac (#33704) 2022-04-28 10:28:27 -04:00
application_info.cc refactor: replace base::StringPrintf() calls with absl::StrFormat() (#44552) 2024-11-04 13:12:50 -08:00
application_info.h fix: devtools allow restoring saved dock state on Windows (#39734) 2023-09-07 17:14:01 +09:00
application_info_linux.cc chore: remove unused nogncheck includes (#43964) 2024-09-26 17:09:42 -05:00
application_info_mac.mm chore: bump chromium to 118.0.5975.0 (main) (#39531) 2023-09-01 15:54:59 +09:00
application_info_win.cc chore: remove unused base/ includes (#43688) 2024-09-12 16:05:37 +02:00
BUILD.gn feat: route deprecated sync clipboard read through permission checks (#45472) 2025-02-05 14:10:18 -05:00
color_util.cc refactor: replace base::StringPrintf() calls with absl::StrFormat() (#44552) 2024-11-04 13:12:50 -08:00
color_util.h fix: modernize-use-equals-default warnings (#44944) 2024-12-03 21:19:32 -06:00
crash_keys.cc refactor: add EmitWarning(v8::Isolate*) helper (#43722) 2024-09-16 15:53:04 -05:00
crash_keys.h chore: used nested namespaces (#34737) 2022-06-29 12:55:47 -07:00
electron_command_line.cc chore: bump chromium to 100.0.4857.0 (main) (#32419) 2022-02-09 18:58:52 -08:00
electron_command_line.h chore: bump chromium to 100.0.4857.0 (main) (#32419) 2022-02-09 18:58:52 -08:00
electron_constants.cc build: remove enable_run_as_node build flag (#38413) 2023-06-08 16:40:08 -04:00
electron_constants.h chore: remove more unused #include calls (#43000) 2024-07-25 11:25:45 +02:00
electron_paths.h feat: allow customizing browser data location (#33554) 2022-05-09 10:26:57 -04:00
heap_snapshot.cc refactor: use base::as_bytes() in WriteAsciiChunk() (#45749) 2025-02-21 10:40:00 -06:00
heap_snapshot.h chore: add ELECTRON_ prefix to C++ include guards (#31925) 2021-11-22 16:34:31 +09:00
key_weak_map.h refactor: simplify KeyWeakMap impl (#43461) 2024-08-26 13:19:05 -05:00
keyboard_util.cc chore: bump chromium to 128.0.6558.0 (main) (#42413) 2024-07-02 09:51:33 +02:00
keyboard_util.h chore: migrate base::StringPiece to std::string_view (#40915) 2024-01-10 19:00:37 -06:00
language_util.h chore: add ELECTRON_ prefix to C++ include guards (#31925) 2021-11-22 16:34:31 +09:00
language_util_linux.cc feat: add app.getPreferredSystemLanguages() API (#36035) 2022-11-09 10:50:43 -05:00
language_util_mac.mm fix: respect system language preferences on Win/macOS (#23247) 2020-05-04 10:49:29 -07:00
language_util_win.cc chore: remove more unused #include calls (#43000) 2024-07-25 11:25:45 +02:00
logging.cc fix: performance-no-automatic-move clang-tidy warnings (#44773) 2024-11-21 15:29:52 +01:00
logging.h chore: add ELECTRON_ prefix to C++ include guards (#31925) 2021-11-22 16:34:31 +09:00
mac_util.h fix: -Wunsafe-buffer-usage warning in didRegisterForRemoteNotificationsWithDeviceToken (#44382) 2024-10-23 20:44:41 -05:00
mac_util.mm fix: -Wunsafe-buffer-usage warning in didRegisterForRemoteNotificationsWithDeviceToken (#44382) 2024-10-23 20:44:41 -05:00
node_bindings.cc fix: oob string read when parsing node_options (#46246) 2025-03-25 08:14:59 -05:00
node_bindings.h fix: support for v8.setHeapSnapshotNearHeapLimit api (#45644) 2025-02-17 15:48:02 +01:00
node_bindings_linux.cc refactor: NodeBindings::Create() returns a unique_ptr (#43361) 2024-08-20 15:34:59 -04:00
node_bindings_linux.h chore: remove unused #includes (#42971) 2024-07-22 11:31:32 +02:00
node_bindings_mac.cc refactor: add EmitWarning(v8::Isolate*) helper (#43722) 2024-09-16 15:53:04 -05:00
node_bindings_mac.h chore: remove unused #includes (#42971) 2024-07-22 11:31:32 +02:00
node_bindings_win.cc chore: remove unused base/ includes (#43688) 2024-09-12 16:05:37 +02:00
node_bindings_win.h chore: remove unused #includes (#42971) 2024-07-22 11:31:32 +02:00
node_includes.h feat: add error event for utility process (#43774) 2024-09-27 10:17:06 +09:00
node_util.cc refactor: fix modernize-return-braced-init-list warnings (#44856) 2024-11-26 22:18:13 -06:00
node_util.h refactor: spanify image utils (#44127) 2024-10-10 09:34:55 -04:00
options_switches.cc feat: route deprecated sync clipboard read through permission checks (#45472) 2025-02-05 14:10:18 -05:00
options_switches.h feat: route deprecated sync clipboard read through permission checks (#45472) 2025-02-05 14:10:18 -05:00
platform_util.cc fix: misc-use-internal-linkage warnings (#44872) 2024-11-27 12:35:37 -06:00
platform_util.h feat: update app.{set|get}LoginItemSettings(settings) (#37244) 2023-10-16 12:25:11 -04:00
platform_util_internal.h chore: used nested namespaces (#34737) 2022-06-29 12:55:47 -07:00
platform_util_linux.cc chore: remove unused nogncheck includes (#43964) 2024-09-26 17:09:42 -05:00
platform_util_mac.mm fix: update shell.openExternal to correctly focus on external window (#44469) 2024-10-31 12:05:44 +01:00
platform_util_win.cc refactor: remove C-style void arg type for no-arg functions (#43884) 2024-09-23 22:37:32 -07:00
plugin.mojom chore: bump chromium to 129.0.6650.0 (main) (#43266) 2024-08-12 10:28:33 +02:00
plugin_info.cc chore: bump chromium to 123.0.6312.5 (main) (#41337) 2024-02-21 15:27:05 -05:00
plugin_info.h chore: bump chromium to 109.0.5382.0 (main) (#36057) 2022-10-27 12:37:04 -04:00
process_util.cc refactor: add EmitWarning(v8::Isolate*) helper (#43722) 2024-09-16 15:53:04 -05:00
process_util.h refactor: remove unused system header includes (34-x-y) (#46135) 2025-03-20 07:57:29 +01:00
skia_util.cc fix: misc-use-internal-linkage warnings (#44872) 2024-11-27 12:35:37 -06:00
skia_util.h refactor: spanify image utils (#44127) 2024-10-10 09:34:55 -04:00
thread_restrictions.h chore: bump chromium to 110.0.5415.0 (main) (#36186) 2022-11-17 14:59:23 -05:00
v8_util.cc refactor: only pass v8::Context to gin_helper::MicrotasksScope constructor (#45505) 2025-02-07 10:03:21 +01:00
v8_util.h fix: -Wunsafe-buffer-usage warning in ChunkedDataPipeReadableStream (#44211) 2024-10-14 10:46:24 +02:00
web_contents_utility.mojom feat: route deprecated sync clipboard read through permission checks (#45472) 2025-02-05 14:10:18 -05:00
world_ids.h chore: add ELECTRON_ prefix to C++ include guards (#31925) 2021-11-22 16:34:31 +09:00