fix: add back fallback wasm-trap handling (#47345)

* fix: add back fallback wasm-trap handling

Refs https://chromium-review.googlesource.com/c/chromium/src/+/5372409

This change sets up wasm-trap handling for the case where content_shell
has not enabled crash reporting but moves the responsibility to
ElectronRendererClient. The default ContentRendererClient assumes
that crash reporting is enabled (crashpad enabled by default) and does
not set up its own handler.

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: fix build

Co-authored-by: deepak1556 <hop2deep@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
This commit is contained in:
trop[bot] 2025-06-10 18:02:14 +02:00 committed by GitHub
commit d2c95a28bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 61 additions and 31 deletions

View file

@ -38,6 +38,8 @@ class ElectronRendererClient : public RendererClientBase {
void UndeferLoad(content::RenderFrame* render_frame);
// content::ContentRendererClient:
void PostIOThreadCreated(
base::SingleThreadTaskRunner* io_thread_task_runner) override;
void RenderFrameCreated(content::RenderFrame*) override;
void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override;
void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) override;
@ -45,6 +47,7 @@ class ElectronRendererClient : public RendererClientBase {
v8::Local<v8::Context> context) override;
void WillDestroyWorkerContextOnWorkerThread(
v8::Local<v8::Context> context) override;
void SetUpWebAssemblyTrapHandler() override;
node::Environment* GetEnvironment(content::RenderFrame* frame) const;