Skip to content

Commit

Permalink
Permanently enable e10s (#2913)
Browse files Browse the repository at this point in the history
Fixes #2912
  • Loading branch information
bluemarvin committed Mar 9, 2020
1 parent f48ca97 commit 0f9e435
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 59 deletions.
10 changes: 0 additions & 10 deletions app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java
Expand Up @@ -543,16 +543,6 @@ void loadFromIntent(final Intent intent) {
SettingsStore.getInstance(this).setHomepage(homepageUri.toString());
}

// Enable/Disable e10s
if (extras.containsKey("e10s")) {
boolean wasEnabled = SettingsStore.getInstance(this).isMultiprocessEnabled();
boolean enabled = extras.getBoolean("e10s", wasEnabled);
if (wasEnabled != enabled) {
SettingsStore.getInstance(this).setMultiprocessEnabled(enabled);
mHandler.postDelayed(() -> SystemUtils.scheduleRestart(this, 100), 500);
}
}

// Open the provided URL in a new tab, if there is no URL provided we just open the homepage
if (extras.containsKey("create_new_tab")) {
openInTab = extras.getBoolean("create_new_tab", false);
Expand Down
Expand Up @@ -49,7 +49,6 @@ SettingsStore getInstance(final @NonNull Context aContext) {
public final static boolean REMOTE_DEBUGGING_DEFAULT = false;
public final static boolean CONSOLE_LOGS_DEFAULT = false;
public final static boolean ENV_OVERRIDE_DEFAULT = false;
public final static boolean MULTIPROCESS_DEFAULT = true;
public final static boolean UI_HARDWARE_ACCELERATION_DEFAULT = true;
public final static boolean UI_HARDWARE_ACCELERATION_DEFAULT_WAVEVR = false;
public final static boolean PERFORMANCE_MONITOR_DEFAULT = true;
Expand Down Expand Up @@ -226,18 +225,6 @@ public void setEnvironmentOverrideEnabled(boolean isEnabled) {
editor.commit();
}


public boolean isMultiprocessEnabled() {
return mPrefs.getBoolean(
mContext.getString(R.string.settings_key_multiprocess_e10s), MULTIPROCESS_DEFAULT);
}

public void setMultiprocessEnabled(boolean isEnabled) {
SharedPreferences.Editor editor = mPrefs.edit();
editor.putBoolean(mContext.getString(R.string.settings_key_multiprocess_e10s), isEnabled);
editor.commit();
}

public boolean isUIHardwareAccelerationEnabled() {
boolean defaultValue = UI_HARDWARE_ACCELERATION_DEFAULT;
if (DeviceType.isWaveBuild()) {
Expand Down
Expand Up @@ -32,7 +32,7 @@ object EngineProvider {
builder.displayDpiOverride(SettingsStore.getInstance(context).displayDpi)
builder.screenSizeOverride(SettingsStore.getInstance(context).maxWindowWidth,
SettingsStore.getInstance(context).maxWindowHeight)
builder.useMultiprocess(SettingsStore.getInstance(context).isMultiprocessEnabled)
builder.useMultiprocess(true)

if (SettingsStore.getInstance(context).transparentBorderWidth > 0) {
builder.useMaxScreenDepth(true)
Expand Down
Expand Up @@ -58,9 +58,6 @@ protected void updateUI() {
mBinding.showConsoleSwitch.setOnCheckedChangeListener(mConsoleLogsListener);
setConsoleLogs(SettingsStore.getInstance(getContext()).isConsoleLogsEnabled(), false);

mBinding.multiprocessSwitch.setOnCheckedChangeListener(mMultiprocessListener);
setMultiprocess(SettingsStore.getInstance(getContext()).isMultiprocessEnabled(), false);

mBinding.performanceMonitorSwitch.setOnCheckedChangeListener(mPerformanceListener);
setPerformance(SettingsStore.getInstance(getContext()).isPerformanceMonitorEnabled(), false);
// Hide Performance Monitor switch until it can handle multiple windows.
Expand Down Expand Up @@ -92,10 +89,6 @@ protected void updateUI() {
setConsoleLogs(value, doApply);
};

private SwitchSetting.OnCheckedChangeListener mMultiprocessListener = (compoundButton, value, doApply) -> {
setMultiprocess(value, doApply);
};

private SwitchSetting.OnCheckedChangeListener mPerformanceListener = (compoundButton, value, doApply) -> {
setPerformance(value, doApply);
};
Expand All @@ -121,9 +114,7 @@ protected void updateUI() {
if (mBinding.showConsoleSwitch.isChecked() != SettingsStore.CONSOLE_LOGS_DEFAULT) {
setConsoleLogs(SettingsStore.CONSOLE_LOGS_DEFAULT, true);
}
if (mBinding.multiprocessSwitch.isChecked() != SettingsStore.MULTIPROCESS_DEFAULT) {
setMultiprocess(SettingsStore.MULTIPROCESS_DEFAULT, true);
}

if (mBinding.servoSwitch.isChecked() != SettingsStore.SERVO_DEFAULT) {
setServo(SettingsStore.SERVO_DEFAULT, true);
}
Expand Down Expand Up @@ -171,17 +162,6 @@ private void setConsoleLogs(boolean value, boolean doApply) {
}
}

private void setMultiprocess(boolean value, boolean doApply) {
mBinding.multiprocessSwitch.setOnCheckedChangeListener(null);
mBinding.multiprocessSwitch.setValue(value, false);
mBinding.multiprocessSwitch.setOnCheckedChangeListener(mMultiprocessListener);

if (doApply) {
SettingsStore.getInstance(getContext()).setMultiprocessEnabled(value);
showRestartDialog();
}
}

private void setUIHardwareAcceleration(boolean value, boolean doApply) {
mBinding.hardwareAccelerationSwitch.setOnCheckedChangeListener(null);
mBinding.hardwareAccelerationSwitch.setValue(value, false);
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/res/layout/options_developer.xml
Expand Up @@ -49,12 +49,6 @@
android:layout_height="wrap_content"
app:description="@string/developer_options_show_console" />

<org.mozilla.vrbrowser.ui.views.settings.SwitchSetting
android:id="@+id/multiprocess_switch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:description="@string/developer_options_multiprocess" />

<org.mozilla.vrbrowser.ui.views.settings.SwitchSetting
android:id="@+id/performance_monitor_switch"
android:layout_width="match_parent"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/non_L10n.xml
Expand Up @@ -11,7 +11,6 @@
<string name="settings_key_remote_debugging" translatable="false">settings_remote_debugging</string>
<string name="settings_key_console_logs" translatable="false">settings_console_logs</string>
<string name="settings_key_environment_override" translatable="false">settings_environment_override</string>
<string name="settings_key_multiprocess_e10s" translatable="false">settings_environment_multiprocess_e10s_v3</string>
<string name="settings_key_performance_monitor" translatable="false">settings_performance_monitor</string>
<string name="settings_key_servo" translatable="false">settings_environment_servo</string>
<string name="settings_key_drm_playback" translatable="false">settings_key_drm_playback</string>
Expand Down
7 changes: 0 additions & 7 deletions app/src/main/res/values/strings.xml
Expand Up @@ -329,13 +329,6 @@
and is used to customize background environments of the app. -->
<string name="developer_options_env_override">Enable Environment Override</string>

<!-- This string labels an On/Off switch in the developer options dialog and is used to toggle
running content in a separate process.
Multiprocessing: the running of two or more programs or sequences of instructions
simultaneously by a computer with more than one central processor.
A dialog should appear with a field labeled with the text, 'Enable Multiprocess'. -->
<string name="developer_options_multiprocess">Enable Multiprocess</string>

<!-- This string labels an On/Off switch in the developer options dialog and is used to toggle
the performance monitor. The Performance monitor is used to detect pages that cause the
browser to run below a target framerate and pauses the page to restore performance.
Expand Down

0 comments on commit 0f9e435

Please sign in to comment.