Bug 1072417 - Remove the browser.tabs.remote pref and turn everything it controls on by default. r=felipe

This commit is contained in:
Jim Mathies 2014-09-29 16:11:08 -05:00
parent c26e725ce1
commit 19c5e2c685
20 changed files with 54 additions and 115 deletions

View File

@ -1177,16 +1177,9 @@ pref("dom.ipc.plugins.enabled.x86_64", true);
pref("dom.ipc.plugins.enabled", true);
#endif
#if defined(NIGHTLY_BUILD)
// browser.tabs.remote is enabled on nightly. However, users won't
// actually get remote tabs unless they enable
// browser.tabs.remote.autostart or they use the "New OOP Window" menu
// option.
pref("browser.tabs.remote", true);
#else
pref("browser.tabs.remote", false);
#endif
// Start the browser in e10s mode
pref("browser.tabs.remote.autostart", false);
pref("browser.tabs.remote.desktopbehavior", true);
#if defined(MOZ_CONTENT_SANDBOX) && defined(XP_WIN)
// This controls whether the content process on Windows is sandboxed.

View File

@ -6952,20 +6952,16 @@ let gRemoteTabsUI = {
return;
}
let remoteTabs = Services.appinfo.browserTabsRemote;
let autostart = Services.appinfo.browserTabsRemoteAutostart;
let newRemoteWindow = document.getElementById("menu_newRemoteWindow");
let newNonRemoteWindow = document.getElementById("menu_newNonRemoteWindow");
if (!remoteTabs) {
newRemoteWindow.hidden = true;
newNonRemoteWindow.hidden = true;
return;
}
#ifdef E10S_TESTING_ONLY
let autostart = Services.appinfo.browserTabsRemoteAutostart;
newRemoteWindow.hidden = autostart;
newNonRemoteWindow.hidden = !autostart;
#else
newRemoteWindow.hidden = true;
newNonRemoteWindow.hidden = true;
#endif
}
};

View File

@ -2563,7 +2563,6 @@
]]>
</body>
</method>
#endif
<method name="moveTabTo">
<parameter name="aTab"/>

View File

@ -1043,33 +1043,31 @@ if (Services.prefs.getBoolPref("privacy.panicButton.enabled")) {
#ifdef E10S_TESTING_ONLY
/**
* The e10s button's purpose is to lower the barrier of entry
* for our Nightly testers to use e10s windows. We'll be removing it
* once remote tabs are enabled. This button should never ever make it
* to production. If it does, that'd be bad, and we should all feel bad.
*/
if (Services.prefs.getBoolPref("browser.tabs.remote")) {
let getCommandFunction = function(aOpenRemote) {
return function(aEvent) {
let win = aEvent.view;
if (win && typeof win.OpenBrowserWindow == "function") {
win.OpenBrowserWindow({remote: aOpenRemote});
}
};
}
let openRemote = !Services.appinfo.browserTabsRemoteAutostart;
// Like the XUL menuitem counterparts, we hard-code these strings in because
// this button should never roll into production.
let buttonLabel = openRemote ? "New e10s Window"
: "New Non-e10s Window";
CustomizableWidgets.push({
id: "e10s-button",
label: buttonLabel,
tooltiptext: buttonLabel,
defaultArea: CustomizableUI.AREA_PANEL,
onCommand: getCommandFunction(openRemote),
});
* The e10s button's purpose is to lower the barrier of entry
* for our Nightly testers to use e10s windows. We'll be removing it
* once remote tabs are enabled. This button should never ever make it
* to production. If it does, that'd be bad, and we should all feel bad.
*/
let getCommandFunction = function(aOpenRemote) {
return function(aEvent) {
let win = aEvent.view;
if (win && typeof win.OpenBrowserWindow == "function") {
win.OpenBrowserWindow({remote: aOpenRemote});
}
};
}
let openRemote = !Services.appinfo.browserTabsRemoteAutostart;
// Like the XUL menuitem counterparts, we hard-code these strings in because
// this button should never roll into production.
let buttonLabel = openRemote ? "New e10s Window"
: "New Non-e10s Window";
CustomizableWidgets.push({
id: "e10s-button",
label: buttonLabel,
tooltiptext: buttonLabel,
defaultArea: CustomizableUI.AREA_PANEL,
onCommand: getCommandFunction(openRemote),
});
#endif

View File

@ -16,6 +16,11 @@ Services.scriptloader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/
Services.prefs.setBoolPref("browser.uiCustomization.skipSourceNodeCheck", true);
registerCleanupFunction(() => Services.prefs.clearUserPref("browser.uiCustomization.skipSourceNodeCheck"));
// Remove temporary e10s related new window options in customize ui,
// they break a lot of tests.
CustomizableUI.destroyWidget("e10s-button");
CustomizableUI.removeWidgetFromArea("e10s-button");
let {synthesizeDragStart, synthesizeDrop} = ChromeUtils;
const kNSXUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

View File

@ -1451,7 +1451,7 @@ Tab.prototype = {
browser.setAttribute("type", "content-targetable");
let useRemote = Services.appinfo.browserTabsRemote;
let useRemote = Services.appinfo.browserTabsRemoteAutostart;
let useLocal = Util.isLocalScheme(aURI);
browser.setAttribute("remote", (!useLocal && useRemote) ? "true" : "false");

View File

@ -94,8 +94,6 @@ pref("toolkit.browser.contentViewExpire", 3000);
pref("toolkit.defaultChromeURI", "chrome://browser/content/browser.xul");
pref("browser.chromeURL", "chrome://browser/content/");
pref("browser.tabs.remote", false);
// Telemetry
#ifdef MOZ_TELEMETRY_ON_BY_DEFAULT
pref("toolkit.telemetry.enabledPreRelease", true);

View File

@ -21,10 +21,7 @@
}
addLoadEvent(function() {
// We don't want to set browser.tabs.remote to true, but still have CPOWs enabled.
SpecialPowers.pushPrefEnv({"set": [["dom.ipc.cpows.force-enabled", true]]}, function() {
window.open("cpows_parent.xul", "", "chrome");
});
window.open("cpows_parent.xul", "", "chrome");
});
]]></script>
</window>

View File

@ -3852,9 +3852,6 @@ ContentParent::RecvKeywordToURI(const nsCString& aKeyword, OptionalInputStreamPa
bool
ContentParent::ShouldContinueFromReplyTimeout()
{
// The only time ContentParent sends blocking messages is for CPOWs, so
// timeouts should only ever occur in electrolysis-enabled sessions.
MOZ_ASSERT(BrowserTabsRemote());
return false;
}

View File

@ -106,7 +106,6 @@ static const CSSSize kDefaultViewportSize(980, 480);
static const char BROWSER_ZOOM_TO_RECT[] = "browser-zoom-to-rect";
static const char BEFORE_FIRST_PAINT[] = "before-first-paint";
static bool sCpowsEnabled = false;
static int32_t sActiveDurationMs = 10;
static bool sActiveDurationMsSet = false;
@ -2783,12 +2782,6 @@ TabChild::InitRenderingState()
BEFORE_FIRST_PAINT,
false);
}
// This state can't change during the lifetime of the child.
sCpowsEnabled = BrowserTabsRemote();
if (Preferences::GetBool("dom.ipc.cpows.force-enabled", false))
sCpowsEnabled = true;
return true;
}
@ -2917,10 +2910,8 @@ TabChild::DoSendBlockingMessage(JSContext* aCx,
return false;
}
InfallibleTArray<CpowEntry> cpows;
if (sCpowsEnabled) {
if (!Manager()->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) {
return false;
}
if (!Manager()->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) {
return false;
}
if (aIsSync) {
return SendSyncMessage(PromiseFlatString(aMessage), data, cpows,
@ -2943,10 +2934,8 @@ TabChild::DoSendAsyncMessage(JSContext* aCx,
return false;
}
InfallibleTArray<CpowEntry> cpows;
if (sCpowsEnabled) {
if (!Manager()->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) {
return false;
}
if (!Manager()->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) {
return false;
}
return SendAsyncMessage(PromiseFlatString(aMessage), data, cpows,
Principal(aPrincipal));

View File

@ -1803,7 +1803,8 @@ nsListControlFrame::MouseDown(nsIDOMEvent* aMouseEvent)
} else {
// NOTE: the combo box is responsible for dropping it down
if (mComboboxFrame) {
if (XRE_GetProcessType() == GeckoProcessType_Content && BrowserTabsRemote()) {
if (XRE_GetProcessType() == GeckoProcessType_Content &&
Preferences::GetBool("browser.tabs.remote.desktopbehavior", false)) {
nsContentUtils::DispatchChromeEvent(mContent->OwnerDoc(), mContent,
NS_LITERAL_STRING("mozshowdropdown"), true,
false);

View File

@ -110,7 +110,6 @@ class B2GDesktopReftest(RefTest):
prefs["browser.firstrun.show.localepicker"] = False
prefs["b2g.system_startup_url"] = "app://test-container.gaiamobile.org/index.html"
prefs["b2g.system_manifest_url"] = "app://test-container.gaiamobile.org/manifest.webapp"
prefs["browser.tabs.remote"] = False
prefs["dom.ipc.tabs.disabled"] = False
prefs["dom.mozBrowserFramesEnabled"] = True
prefs["font.size.inflation.emPerLine"] = 0

View File

@ -425,7 +425,6 @@ class B2GRemoteReftest(RefTest):
prefs["browser.firstrun.show.localepicker"] = False
prefs["b2g.system_startup_url"] = "app://test-container.gaiamobile.org/index.html"
prefs["b2g.system_manifest_url"] = "app://test-container.gaiamobile.org/manifest.webapp"
prefs["browser.tabs.remote"] = False
prefs["dom.ipc.tabs.disabled"] = False
prefs["dom.mozBrowserFramesEnabled"] = True
prefs["font.size.inflation.emPerLine"] = 0
@ -439,7 +438,6 @@ class B2GRemoteReftest(RefTest):
prefs["toolkit.telemetry.notifiedOptOut"] = 999
if options.oop:
prefs['browser.tabs.remote'] = True
prefs['browser.tabs.remote.autostart'] = True
prefs['reftest.browser.iframe.enabled'] = True

View File

@ -26,8 +26,6 @@ pref("toolkit.browser.contentViewExpire", 3000);
pref("toolkit.defaultChromeURI", "chrome://browser/content/browser.xul");
pref("browser.chromeURL", "chrome://browser/content/");
pref("browser.tabs.remote", false);
// If a tab has not been active for this long (seconds), then it may be
// turned into a zombie tab to preemptively free up memory. -1 disables time-based
// expiration (but low-memory conditions may still require the tab to be zombified).

View File

@ -1128,7 +1128,6 @@ class Mochitest(MochitestUtilsMixin):
""" create the profile and add optional chrome bits and files if requested """
if options.browserChrome and options.timeout:
options.extraPrefs.append("testing.browserTestHarness.timeout=%d" % options.timeout)
options.extraPrefs.append("browser.tabs.remote=%s" % ('true' if options.e10s else 'false'))
options.extraPrefs.append("browser.tabs.remote.autostart=%s" % ('true' if options.e10s else 'false'))
options.extraPrefs.append("browser.tabs.remote.sandbox=%s" % options.contentSandbox)

View File

@ -206,10 +206,10 @@ RUN_REFTEST_B2G = rm -f ./$@.log && $(PYTHON) _tests/reftest/runreftestb2g.py \
ifeq ($(OS_ARCH),WINNT) #{
# GPU-rendered shadow layers are unsupported here
OOP_CONTENT = --setpref=layers.async-pan-zoom.enabled=true --setpref=browser.tabs.remote=true --setpref=browser.tabs.remote.autostart=true --setpref=layers.acceleration.disabled=true
OOP_CONTENT = --setpref=layers.async-pan-zoom.enabled=true --setpref=browser.tabs.remote.autostart=true --setpref=layers.acceleration.disabled=true
GPU_RENDERING =
else
OOP_CONTENT = --setpref=layers.async-pan-zoom.enabled=true --setpref=browser.tabs.remote=true --setpref=browser.tabs.remote.autostart=true
OOP_CONTENT = --setpref=layers.async-pan-zoom.enabled=true --setpref=browser.tabs.remote.autostart=true
GPU_RENDERING = --setpref=layers.acceleration.force-enabled=true
endif #}

View File

@ -494,8 +494,8 @@ FormAutoCompleteResult.prototype = {
};
let remote = Services.appinfo.browserTabsRemote;
if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT && remote) {
if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT &&
Services.prefs.getBoolPref("browser.tabs.remote.desktopbehavior", false)) {
// Register the stub FormAutoComplete module in the child which will
// forward messages to the parent through the process message manager.
let component = [FormAutoCompleteChild];

View File

@ -841,16 +841,7 @@ nsXULAppInfo::GetProcessID(uint32_t* aResult)
return NS_OK;
}
static bool gBrowserTabsRemote = false;
static bool gBrowserTabsRemoteInitialized = false;
NS_IMETHODIMP
nsXULAppInfo::GetBrowserTabsRemote(bool* aResult)
{
*aResult = BrowserTabsRemote();
return NS_OK;
}
static bool gBrowserTabsRemoteAutostart = false;
static bool gBrowserTabsRemoteAutostartInitialized = false;
@ -4565,17 +4556,6 @@ XRE_GetProcessType()
return mozilla::startup::sChildProcessType;
}
bool
mozilla::BrowserTabsRemote()
{
if (!gBrowserTabsRemoteInitialized) {
gBrowserTabsRemote = Preferences::GetBool("browser.tabs.remote", false);
gBrowserTabsRemoteInitialized = true;
}
return gBrowserTabsRemote;
}
bool
mozilla::BrowserTabsRemoteAutostart()
{

View File

@ -809,8 +809,8 @@ nsWindow::OnGlobalAndroidEvent(AndroidGeckoEvent *ae)
gAndroidScreenBounds.width = newScreenWidth;
gAndroidScreenBounds.height = newScreenHeight;
if (XRE_GetProcessType() != GeckoProcessType_Default ||
!BrowserTabsRemote()) {
if (XRE_GetProcessType() != GeckoProcessType_Default &&
!Preferences::GetBool("browser.tabs.remote.desktopbehavior", false)) {
break;
}

View File

@ -7,8 +7,6 @@
%{C++
namespace mozilla {
// Simple C++ getter for nsIXULRuntime::browserTabsRemote
bool BrowserTabsRemote();
// Simple C++ getter for nsIXULRuntime::browserTabsRemoteAutostart
// This getter is a temporary function that checks for special
// conditions in which e10s support is not great yet, and should
@ -25,7 +23,7 @@ bool BrowserTabsRemoteAutostart();
* stable/frozen, please contact Benjamin Smedberg.
*/
[scriptable, uuid(789073a0-3f4a-11e4-916c-0800200c9a66)]
[scriptable, uuid(588831D6-7576-4CEA-B368-3AAB76CD9FCC)]
interface nsIXULRuntime : nsISupports
{
/**
@ -87,12 +85,6 @@ interface nsIXULRuntime : nsISupports
*/
readonly attribute unsigned long processID;
/**
* If true, browser tabs may be opened in a different process from the main
* browser UI.
*/
readonly attribute boolean browserTabsRemote;
/**
* If true, browser tabs may be opened by default in a different process
* from the main browser UI.