mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Disabled "Terminate" button in about:support if no GPU process is running. (bug 1331818, r=gwright)
--HG-- extra : rebase_source : c8b78efb9ba542cad08ace044fa1124f284eb2e9
This commit is contained in:
parent
fdb497ba5d
commit
5c8e4bed65
@ -156,6 +156,10 @@ GPUProcessManager::DisableGPUProcess(const char* aMessage)
|
||||
|
||||
DestroyProcess();
|
||||
ShutdownVsyncIOThread();
|
||||
|
||||
if (nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService()) {
|
||||
obs->NotifyObservers(nullptr, "gpu-process:disabled", nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -297,6 +297,20 @@ var snapshotFormatters = {
|
||||
windowUtils.terminateGPUProcess();
|
||||
});
|
||||
|
||||
let removeObserver = function() {
|
||||
if (listener !== null) {
|
||||
Services.obs.removeObserver(listener, "gpu-process:disabled");
|
||||
listener = null;
|
||||
}
|
||||
};
|
||||
let listener = function(subject, topic) {
|
||||
gpuProcessKillButton.disabled = true;
|
||||
removeObserver();
|
||||
};
|
||||
|
||||
Services.obs.addObserver(listener, "gpu-process:disabled", false);
|
||||
window.addEventListener("unload", removeObserver);
|
||||
|
||||
gpuProcessKillButton.textContent = strings.GetStringFromName("gpuProcessKillButton");
|
||||
addRow("diagnostics", "GPUProcessPid", gpuProcessPid);
|
||||
addRow("diagnostics", "GPUProcess", [gpuProcessKillButton]);
|
||||
|
Loading…
Reference in New Issue
Block a user