electron/shell/common/api
Calvin 37639b5400
refactor: replace gin_helper::MicrotasksScope with v8::MicrotasksScope (#46963)
* Remove microtasks_scope.h and microtasks_scope.cc

* Use v8::MicrotasksScope when ignoring browser checkpoint

These call always skip the browser checkpoint, so they are equivalent to using v8::MicrotasksScope directly (modulo the optional wrapper behavior).

* Remove MicrotasksScope from node_bindings.cc

This code seems contradictory: it explicitly specifies "do not run microtasks" yet runs a microtask checkpoint in the browser process.

Looking at its history, it [was introduced][1] with the intention to not run microtasks, but a [subtle C++ language behavior][2] caused it to do the opposite later in the same roll. Since the original intention was to not run microtasks, and since that is also the simplest explanation, we can assume `ignore_browser_checkpoint` should be true and migrate this to `v8::MicrotasksScope` as it is equivalent (modulo the optional wrapper behavior).

[1]: a4ea80dd47 (diff-efe58cf03c97028f37f801db044d396a5f428686da6595d2c692f1c052bbd09c)
[2]: https://github.com/electron/electron/pull/43185

* Migrate gin_helper/promise.h and gin_helper/promise.cc to v8::MicrotasksScope

Restores the [original][1] behavior of running the microtask checkpoint at destruction, but preserves the behavior of running microtasks in the browser process. This had last changed in the migration to gin_helper::MicroTasks.

[1]: https://github.com/electron/electron/pull/16401
2025-05-07 14:10:34 -05:00
..
api.mojom feat: route deprecated sync clipboard read through permission checks (#45377) 2025-02-05 15:13:29 +09:00
crashpad_support.cc chore: rename built-in modules to bindings to match naming update in node (#37182) 2023-02-09 10:31:38 +09:00
electron_api_asar.cc chore: bump chromium to 133.0.6878.0 (main) (#44831) 2024-12-10 13:16:07 -06:00
electron_api_clipboard.cc refactor: make node Buffers more friendly to base::span / std::span (#46724) 2025-04-25 08:00:09 -05:00
electron_api_clipboard.h chore: more iwyu (#43063) 2024-07-29 12:42:57 -05:00
electron_api_clipboard_mac.mm chore: bump chromium to 105.0.5173.0 (main) (#34770) 2022-07-13 17:26:16 -04:00
electron_api_command_line.cc fix: hard crash on invalid command line switches (#46004) 2025-03-26 08:14:03 -05:00
electron_api_environment.cc chore: bump chromium to 137.0.7149.0 (main) (#46777) 2025-04-28 11:39:12 -04:00
electron_api_native_image.cc refactor: add gin_helper::Dictionary::ValueOrDefault() (#46939) 2025-05-06 15:20:12 -05:00
electron_api_native_image.h chore: bump chromium to 134.0.6998.10 (main) (#45564) 2025-02-11 17:26:39 -06:00
electron_api_native_image_mac.mm fix: -Wunsafe-buffer-usage warning in didRegisterForRemoteNotificationsWithDeviceToken (#44348) 2024-10-23 14:18:22 -05:00
electron_api_native_image_win.cc chore: bump chromium to 134.0.6998.10 (main) (#45564) 2025-02-11 17:26:39 -06:00
electron_api_net.cc chore: replace absl::optional<T> with std::optional<T> (#40928) 2024-01-10 16:23:35 -06:00
electron_api_shell.cc fix: crash parsing CLSID in shell.readShortcutLink() (#45195) 2025-01-27 15:22:56 -05:00
electron_api_testing.cc fix: prevent log files being written to current directory on Windows (#44413) 2025-05-02 16:27:29 -05:00
electron_api_url_loader.cc chore: bump chromium to 137.0.7128.1 (main) (#46482) 2025-04-22 15:53:29 -04:00
electron_api_url_loader.h chore: bump chromium to 137.0.7141.0 (main) (#46725) 2025-04-24 17:18:38 +09:00
electron_api_v8_util.cc refactor: return-braced-init-list pt 2 of 2 (#44870) 2024-11-29 11:44:33 -06:00
electron_bindings.cc refactor: replace gin_helper::MicrotasksScope with v8::MicrotasksScope (#46963) 2025-05-07 14:10:34 -05:00
electron_bindings.h chore: more iwyu (#43063) 2024-07-29 12:42:57 -05:00
features.cc feat: replace BrowserView with WebContentsView (#35658) 2023-12-13 13:01:03 -08:00