Add killed argument for webContents.on("crashed") and app.on("gpu-process-crashed...
authorMilan Burda <milan.burda@gmail.com>
Sun, 18 Sep 2016 00:00:45 +0000 (17:00 -0700)
committerMilan Burda <milan.burda@gmail.com>
Sun, 18 Sep 2016 00:02:36 +0000 (17:02 -0700)
atom/browser/api/atom_api_app.cc
atom/browser/api/atom_api_app.h
atom/browser/api/atom_api_web_contents.cc
docs/api/app.md
docs/api/web-contents.md

index 751293ee41a90153574e7e73cc50d8a66605b3c1..323a80cc8a25d25c8e317ad19af9838093a795d0 100644 (file)
@@ -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) {
index 13641d04c266ec96007b30d0de424e0ca7be8e4b..c2afb15232eca42d6f9d93203d2679e43150ba39 100644 (file)
@@ -102,7 +102,7 @@ class App : public AtomBrowserClient::Delegate,
       std::unique_ptr<content::ClientCertificateDelegate> 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.
index d9b47d05552840834c0c3c33f9968fb9e9c8d334..f7b8f1b7ba63bef59d13f7225f2ea01aab6b793a 100644 (file)
@@ -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,
index 98450ee6f0fc507d1e1b800bc65403eb1e9bd3d7..17194a39e83f9b7f53752d90bf970654ed30be72 100644 (file)
@@ -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_
 
index 55cbfc63c33fb196e0a05465759898a479b5e13c..c2a1a35724024c6b59f70044dfa33b66bee90fe2 100644 (file)
@@ -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'