electron/shell/renderer/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
..
context_bridge perf: use absl::flat_hash_map instead of std::unordered_map (#46202) 2025-03-24 10:09:14 +01:00
electron_api_context_bridge.cc fix: crash when drag-dropping some files (#46253) 2025-03-26 17:17:23 -05:00
electron_api_context_bridge.h feat: contextBridge.executeInMainWorld (#45229) 2025-01-23 21:12:46 -05:00
electron_api_crash_reporter_renderer.cc build: make is_mas_build a generated header instead of config (#43737) 2024-09-17 01:38:56 -07:00
electron_api_ipc_renderer.cc feat: service worker preload scripts for improved extensions support (#44411) 2025-01-31 09:32:45 -05:00
electron_api_spell_check_client.cc refactor: replace gin_helper::MicrotasksScope with v8::MicrotasksScope (#46963) 2025-05-07 14:10:34 -05:00
electron_api_spell_check_client.h chore: bump chromium to 134.0.6988.0 (main) (#45334) 2025-02-06 15:30:54 -05:00
electron_api_web_frame.cc chore: bump chromium to 136.0.7053.1 (main) (#45906) 2025-03-07 11:35:59 -06:00
electron_api_web_utils.cc feat: add webUtils module with getPathForFile method (#38776) 2023-11-20 15:59:36 -08:00
electron_api_web_utils.h chore: more iwyu (#43063) 2024-07-29 12:42:57 -05:00