feat: add 'gpu-info-update' event to app (#18250)

This commit is contained in:
Milan Burda 2019-05-18 03:06:48 +02:00 committed by Cheng Zhao
parent 111baba29c
commit 2b4ad2cb09
3 changed files with 11 additions and 0 deletions

View file

@ -773,6 +773,10 @@ void App::SelectClientCertificate(
}
}
void App::OnGpuInfoUpdate() {
Emit("gpu-info-update");
}
void App::OnGpuProcessCrashed(base::TerminationStatus status) {
Emit("gpu-process-crashed",
status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED);

View file

@ -157,6 +157,7 @@ class App : public AtomBrowserClient::Delegate,
bool* no_javascript_access) override;
// content::GpuDataManagerObserver:
void OnGpuInfoUpdate() override;
void OnGpuProcessCrashed(base::TerminationStatus status) override;
// content::BrowserChildProcessObserver:

View file

@ -343,6 +343,10 @@ app.on('login', (event, webContents, request, authInfo, callback) => {
})
```
### Event: 'gpu-info-update'
Emitted whenever there is a GPU info update.
### Event: 'gpu-process-crashed'
Returns:
@ -1012,6 +1016,8 @@ Returns [`ProcessMetric[]`](structures/process-metric.md): Array of `ProcessMetr
Returns [`GPUFeatureStatus`](structures/gpu-feature-status.md) - The Graphics Feature Status from `chrome://gpu/`.
**Note:** This information is only usable after the `gpu-info-update` event is emitted.
### `app.getGPUInfo(infoType)`
* `infoType` String - Values can be either `basic` for basic info or `complete` for complete info.