feat: add 'gpu-info-update' event to app (#18250)
This commit is contained in:
parent
111baba29c
commit
2b4ad2cb09
3 changed files with 11 additions and 0 deletions
|
@ -773,6 +773,10 @@ void App::SelectClientCertificate(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void App::OnGpuInfoUpdate() {
|
||||||
|
Emit("gpu-info-update");
|
||||||
|
}
|
||||||
|
|
||||||
void App::OnGpuProcessCrashed(base::TerminationStatus status) {
|
void App::OnGpuProcessCrashed(base::TerminationStatus status) {
|
||||||
Emit("gpu-process-crashed",
|
Emit("gpu-process-crashed",
|
||||||
status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED);
|
status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED);
|
||||||
|
|
|
@ -157,6 +157,7 @@ class App : public AtomBrowserClient::Delegate,
|
||||||
bool* no_javascript_access) override;
|
bool* no_javascript_access) override;
|
||||||
|
|
||||||
// content::GpuDataManagerObserver:
|
// content::GpuDataManagerObserver:
|
||||||
|
void OnGpuInfoUpdate() override;
|
||||||
void OnGpuProcessCrashed(base::TerminationStatus status) override;
|
void OnGpuProcessCrashed(base::TerminationStatus status) override;
|
||||||
|
|
||||||
// content::BrowserChildProcessObserver:
|
// content::BrowserChildProcessObserver:
|
||||||
|
|
|
@ -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'
|
### Event: 'gpu-process-crashed'
|
||||||
|
|
||||||
Returns:
|
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/`.
|
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)`
|
### `app.getGPUInfo(infoType)`
|
||||||
|
|
||||||
* `infoType` String - Values can be either `basic` for basic info or `complete` for complete info.
|
* `infoType` String - Values can be either `basic` for basic info or `complete` for complete info.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue