diff --git a/docs/api/app.md b/docs/api/app.md index bc69f3fdc4..fbad31e9e9 100755 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -377,20 +377,6 @@ page. Emitted whenever there is a GPU info update. -### Event: 'gpu-process-crashed' _Deprecated_ - -Returns: - -* `event` Event -* `killed` boolean - -Emitted when the GPU process crashes or is killed. - -**Deprecated:** This event is superceded by the `child-process-gone` event -which contains more information about why the child process disappeared. It -isn't always because it crashed. The `killed` boolean can be replaced by -checking `reason === 'killed'` when you switch to that event. - ### Event: 'render-process-gone' Returns: diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index 8636e4bedc..ddffa5f081 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -42,6 +42,19 @@ win.webContents.on('render-process-gone', (event, details) => { /* ... */ }) webview.addEventListener('render-process-gone', (event) => { /* ... */ }) ``` +### Removed: `gpu-process-crashed` event on `app` + +The `gpu-process-crashed` event on `app` has been removed. +Use the new `child-process-gone` event instead. + +```js +// Removed +app.on('gpu-process-crashed', (event, killed) => { /* ... */ }) + +// Replace with +app.on('child-process-gone', (event, details) => { /* ... */ }) +``` + ## Planned Breaking API Changes (28.0) ### Behavior Changed: `WebContents.backgroundThrottling` set to false affects all `WebContents` in the host `BrowserWindow` diff --git a/lib/browser/api/app.ts b/lib/browser/api/app.ts index 3127166de7..f952dcd019 100644 --- a/lib/browser/api/app.ts +++ b/lib/browser/api/app.ts @@ -1,7 +1,6 @@ import * as fs from 'fs'; import { Menu } from 'electron/main'; -import * as deprecate from '@electron/internal/common/deprecate'; const bindings = process._linkedBinding('electron_browser_app'); const commandLine = process._linkedBinding('electron_common_command_line'); @@ -112,9 +111,3 @@ for (const name of events) { webContents.emit(name, event, ...args); }); } - -// Deprecation. -deprecate.event(app, 'gpu-process-crashed', 'child-process-gone', () => { - // the old event is still emitted by App::OnGpuProcessCrashed() - return undefined; -}); diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index 5cfbdafdff..62c567f202 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -842,10 +842,6 @@ void App::OnGpuInfoUpdate() { Emit("gpu-info-update"); } -void App::OnGpuProcessCrashed() { - Emit("gpu-process-crashed", true); -} - void App::BrowserChildProcessLaunchedAndConnected( const content::ChildProcessData& data) { ChildProcessLaunched(data.process_type, data.id, data.GetProcess().Handle(), diff --git a/shell/browser/api/electron_api_app.h b/shell/browser/api/electron_api_app.h index 3b4d15c189..035e34b589 100644 --- a/shell/browser/api/electron_api_app.h +++ b/shell/browser/api/electron_api_app.h @@ -153,7 +153,6 @@ class App : public ElectronBrowserClient::Delegate, // content::GpuDataManagerObserver: void OnGpuInfoUpdate() override; - void OnGpuProcessCrashed() override; // content::BrowserChildProcessObserver: void BrowserChildProcessLaunchedAndConnected( diff --git a/spec/ts-smoke/electron/main.ts b/spec/ts-smoke/electron/main.ts index d458fcebe4..a324586e3f 100644 --- a/spec/ts-smoke/electron/main.ts +++ b/spec/ts-smoke/electron/main.ts @@ -441,6 +441,9 @@ app.configureHostResolver({ secureDnsMode: 'foo' }); // @ts-expect-error Removed API console.log(app.runningUnderRosettaTranslation); +// @ts-expect-error Removed API +app.on('gpu-process-crashed', () => {}); + // @ts-expect-error Removed API app.on('renderer-process-crashed', () => {});