IJPL-162747 Enable out-of-process JCEF by default

fix some warnings along the way

GitOrigin-RevId: 3cd039d1b276f7aa9d6c8723c46aee208ef35e60
This commit is contained in:
Artem Bochkarev
2024-09-25 14:19:01 +04:00
committed by intellij-monorepo-bot
parent 2466c3a39b
commit 973fbd1607
3 changed files with 12 additions and 7 deletions

View File

@@ -95,7 +95,12 @@ public final class JBCefApp {
addCefCustomSchemeHandlerFactory(new JBCefFileSchemeHandlerFactory());
if (RegistryManager.getInstance().is("ide.browser.jcef.out-of-process.enabled")) {
System.setProperty("jcef.remote.enabled", "true");
if (Boolean.getBoolean("idea.debug.mode"))
LOG.debug("Out-of-process jcef mode is disabled (because idea.debug.mode=true)");
else if (SystemInfo.isWayland)
LOG.debug("Out-of-process jcef mode is temporarily disabled in Wayland"); // TODO: fix https://youtrack.jetbrains.com/issue/IJPL-161273
else
System.setProperty("jcef.remote.enabled", "true");
}
Boolean result = null;
@@ -103,9 +108,11 @@ public final class JBCefApp {
// Temporary use reflection to avoid jcef-version increment
Method m = CefApp.class.getMethod("isRemoteEnabled");
result = (boolean)m.invoke(CefApp.class);
} catch (Throwable e) {}
} catch (Throwable e) {
LOG.warn(e);
}
IS_REMOTE_ENABLED = result == null ? false : result;
IS_REMOTE_ENABLED = result != null && result;
}
private JBCefApp(@NotNull JCefAppConfig config) throws IllegalStateException {

View File

@@ -1,8 +1,6 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ui.jcef;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.ui.Gray;
import com.intellij.util.JBHiDPIScaledImage;
import com.intellij.util.RetinaImage;
import com.jetbrains.JBR;
@@ -26,7 +24,7 @@ import java.util.concurrent.ConcurrentHashMap;
@SuppressWarnings("NonPrivateFieldAccessedInSynchronizedContext")
class JBCefNativeOsrHandler extends JBCefOsrHandler implements CefNativeRenderHandler {
private static final int CLEAN_CACHE_TIME_MS = Integer.getInteger("jcef.remote.osr.clean_cache_time_ms", 10*1000); // 10 sec
private static final boolean FORCE_USE_SOFTWARE_RENDERING = true; // NOTE: temporary enabled until fixed IJPL-161293
private static final boolean FORCE_USE_SOFTWARE_RENDERING = !Boolean.getBoolean("jcef.remote.enable_hardware_rendering"); // NOTE: temporary enabled until fixed IJPL-161293
private final Map<String, SharedMemory.WithRaster> mySharedMemCache = new ConcurrentHashMap<>();
private SharedMemory.WithRaster myCurrentFrame;

View File

@@ -400,7 +400,7 @@ ide.browser.jcef.svg-viewer.enabled=true
ide.browser.jcef.svg-viewer.enabled.description=Enables the image SVG viewer based on JCEF
ide.browser.jcef.svg-viewer.debug=false
ide.browser.jcef.svg-viewer.debug.description=Debug UI in the viewer
ide.browser.jcef.out-of-process.enabled=false
ide.browser.jcef.out-of-process.enabled=true
ide.browser.jcef.out-of-process.enabled.restartRequired=true
ide.browser.jcef.out-of-process.enabled.description=Enable JCEF is a separate process