Commit f4924c30 authored by Bo Liu's avatar Bo Liu Committed by Commit Bot

android: Disable binding mangement for site isolation

This is a speculative experiment (since it's a simple change) to see if
it has any effect on the rate of sad tabs when site isolation is
enabled.

This should be reverted before M69 branch point, and definitely before
site isolation actually ships to beta.

Bug: 855037
Bug: 859208
Change-Id: I90c7cce4a03603d8bd9772ead804eeabb4114bad
Reviewed-on: https://chromium-review.googlesource.com/1120864
Commit-Queue: Bo <boliu@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571660}
parent 206531ab
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_launcher_utils.h" #include "content/public/browser/child_process_launcher_utils.h"
#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_process_host.h"
#include "content/public/browser/site_isolation_policy.h"
#include "content/public/common/content_descriptors.h" #include "content/public/common/content_descriptors.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "jni/ChildProcessLauncherHelperImpl_jni.h" #include "jni/ChildProcessLauncherHelperImpl_jni.h"
...@@ -198,6 +199,12 @@ static void JNI_ChildProcessLauncherHelperImpl_SetTerminationInfo( ...@@ -198,6 +199,12 @@ static void JNI_ChildProcessLauncherHelperImpl_SetTerminationInfo(
remaining_process_with_waived_binding; remaining_process_with_waived_binding;
} }
static jboolean JNI_ChildProcessLauncherHelperImpl_IsSiteIsolationEnabled(
JNIEnv* env,
const JavaParamRef<jclass>&) {
return SiteIsolationPolicy::UseDedicatedProcessesForAllSites();
}
// static // static
bool ChildProcessLauncherHelper::TerminateProcess(const base::Process& process, bool ChildProcessLauncherHelper::TerminateProcess(const base::Process& process,
int exit_code) { int exit_code) {
......
...@@ -195,6 +195,13 @@ public final class ChildProcessLauncherHelperImpl { ...@@ -195,6 +195,13 @@ public final class ChildProcessLauncherHelperImpl {
private static ChildProcessLauncherHelperImpl createAndStart( private static ChildProcessLauncherHelperImpl createAndStart(
long nativePointer, String[] commandLine, FileDescriptorInfo[] filesToBeMapped) { long nativePointer, String[] commandLine, FileDescriptorInfo[] filesToBeMapped) {
assert LauncherThread.runningOnLauncherThread(); assert LauncherThread.runningOnLauncherThread();
// Experiment that disables binding management if site isolation is enabled.
if (getBindingManager() != null && nativeIsSiteIsolationEnabled()) {
getBindingManager().removeAllConnections();
sBindingManager = null;
}
String processType = String processType =
ContentSwitchUtils.getSwitchValue(commandLine, ContentSwitches.SWITCH_PROCESS_TYPE); ContentSwitchUtils.getSwitchValue(commandLine, ContentSwitches.SWITCH_PROCESS_TYPE);
...@@ -656,4 +663,5 @@ public final class ChildProcessLauncherHelperImpl { ...@@ -656,4 +663,5 @@ public final class ChildProcessLauncherHelperImpl {
private static native void nativeSetTerminationInfo(long termiantionInfoPtr, private static native void nativeSetTerminationInfo(long termiantionInfoPtr,
@ChildBindingState int bindingState, boolean killedByUs, int remainingStrong, @ChildBindingState int bindingState, boolean killedByUs, int remainingStrong,
int remainingModerate, int remainingWaived); int remainingModerate, int remainingWaived);
private static native boolean nativeIsSiteIsolationEnabled();
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment