diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 751293ee41a9..323a80cc8a25 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -585,8 +585,9 @@ void App::SelectClientCertificate( cert_request_info->client_certs[0].get()); } -void App::OnGpuProcessCrashed(base::TerminationStatus exit_code) { - Emit("gpu-process-crashed"); +void App::OnGpuProcessCrashed(base::TerminationStatus status) { + Emit("gpu-process-crashed", + status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED); } base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) { diff --git a/atom/browser/api/atom_api_app.h b/atom/browser/api/atom_api_app.h index 13641d04c266..c2afb15232ec 100644 --- a/atom/browser/api/atom_api_app.h +++ b/atom/browser/api/atom_api_app.h @@ -102,7 +102,7 @@ class App : public AtomBrowserClient::Delegate, std::unique_ptr delegate) override; // content::GpuDataManagerObserver: - void OnGpuProcessCrashed(base::TerminationStatus exit_code) override; + void OnGpuProcessCrashed(base::TerminationStatus status) override; private: // Get/Set the pre-defined path in PathService. diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 9418162840da..68a7a22ec69b 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -586,7 +586,7 @@ void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) { } void WebContents::RenderProcessGone(base::TerminationStatus status) { - Emit("crashed"); + Emit("crashed", status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED); } void WebContents::PluginCrashed(const base::FilePath& plugin_path, diff --git a/docs/api/app.md b/docs/api/app.md index 98450ee6f0fc..17194a39e83f 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -280,7 +280,12 @@ app.on('login', (event, webContents, request, authInfo, callback) => { ### Event: 'gpu-process-crashed' -Emitted when the gpu process crashes. +Returns: + +* `event` Event +* `killed` Boolean + +Emitted when the gpu process crashes or is killed. ### Event: 'accessibility-support-changed' _macOS_ _Windows_ diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 289b0e4b0903..21a114928151 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -203,7 +203,12 @@ are clicked or when the DOM `hashchange` event is triggered. #### Event: 'crashed' -Emitted when the renderer process has crashed. +Returns: + +* `event` Event +* `killed` Boolean + +Emitted when the renderer process crashes or is killed. #### Event: 'plugin-crashed'