electron/shell/renderer/api
Calvin f15fa56e38
refactor: reduce & remove no-op MicrotasksScope calls (#46681)
* fix: do not run microtasks in V8Serializer in browser process

* Remove no-op MicrotasksScope in `shell/browser/api/electron_api_auto_updater.cc`

This call was added in https://github.com/electron/electron/pull/40576 as an expansion of `gin_helper::EmitEvent`.

Since this only runs in the browser process and `bool ignore_browser_checkpoint = true` this code is a no-op.

Node should perform a microtask checkpoint if necessary in `node::MakeCallback`.

* Remove no-op MicrotasksScope in `shell/common/api/electron_bindings.cc`

This method is only called by the browser process. The containing function, `ElectronBindings::DidReceiveMemoryDump`, is only used in two places:

* `ElectronBindings::GetProcessMemoryInfo` in the same file, which has a `CHECK` that it's running in the browser process at the top.
* From `shell/browser/api/electron_api_web_contents.cc`, which is only run in the browser process.

Added a DCHECK for clarity and validation.

* Replace `gin_helper::MicrotasksScope` with `v8::MicrotasksScope` in `shell/renderer/`

The browser check is unnecessary in the renderer. Since `gin_helper::MicrotasksScope` will always act exactly like `v8::MicrotasksScope`, it's clear to just use the v8 object directly. This also brings them in line with the many other uses of `v8::MicrotasksScope` in `shell/renderer/`.
2025-04-19 12:18:03 -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: reduce & remove no-op MicrotasksScope calls (#46681) 2025-04-19 12:18:03 -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