mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-13 15:52:01 +07:00
IJPL-164884 Shutdown CEF only when GPU subprocess constantly recreates
because each CefBrowser instance creates renderer subprocess (cherry picked from commit 2bc00696cd34938874c304872006eed328814ef6) IJ-CR-148229 GitOrigin-RevId: 49c27cee3f36799ffec82846ba2ad3d57c2a3674
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cd45476ae1
commit
01cb90eb84
@@ -480,9 +480,7 @@ public final class JBCefApp {
|
||||
|
||||
private static class MyCefAppHandler extends CefAppHandlerAdapter {
|
||||
private final int myGPUCrashLimit;
|
||||
private final int myTotalCrashLimit;
|
||||
private int myGPULaunchCounter = 0;
|
||||
private int myLaunchCounter = 0;
|
||||
private boolean myNotificationShown = false;
|
||||
private final String myArgs;
|
||||
|
||||
@@ -491,9 +489,8 @@ public final class JBCefApp {
|
||||
myArgs = Arrays.toString(args);
|
||||
if (trackGPUCrashes) {
|
||||
myGPUCrashLimit = Integer.getInteger("ide.browser.jcef.gpu.infinitecrash.internallimit", 10);
|
||||
myTotalCrashLimit = myGPUCrashLimit*2;
|
||||
} else {
|
||||
myGPUCrashLimit = myTotalCrashLimit = -1;
|
||||
myGPUCrashLimit = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,21 +524,16 @@ public final class JBCefApp {
|
||||
|
||||
@Override
|
||||
public void onBeforeChildProcessLaunch(String command_line) {
|
||||
++myLaunchCounter;
|
||||
if (command_line == null)
|
||||
if (command_line == null || !command_line.contains("--type=gpu-process"))
|
||||
return;
|
||||
|
||||
if (command_line.contains("--type=gpu-process")) {
|
||||
++myGPULaunchCounter;
|
||||
if (myGPUCrashLimit >= 0 && myGPULaunchCounter > myGPUCrashLimit && !myNotificationShown) {
|
||||
++myGPULaunchCounter;
|
||||
if (myGPUCrashLimit >= 0 && myGPULaunchCounter > myGPUCrashLimit) {
|
||||
if (!myNotificationShown) {
|
||||
ApplicationManager.getApplication().executeOnPooledThread(() -> SettingsHelper.showNotificationDisableGPU());
|
||||
myNotificationShown = true;
|
||||
}
|
||||
}
|
||||
if (myTotalCrashLimit >= 0) {
|
||||
if (myLaunchCounter > myTotalCrashLimit) {
|
||||
ApplicationManager.getApplication().executeOnPooledThread(() -> CefApp.getInstance().dispose());
|
||||
}
|
||||
ApplicationManager.getApplication().executeOnPooledThread(() -> CefApp.getInstance().dispose());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user