Bug 960783 - Support "new out-of-process window" menu item in nightly (r=felipe,bsmedberg,trevor,ted)
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
#include "nsIArray.h"
|
#include "nsIArray.h"
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
#include "nsIDocShellTreeItem.h"
|
#include "nsIDocShellTreeItem.h"
|
||||||
#include "nsIXULRuntime.h"
|
#include "nsXULAppAPI.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::a11y;
|
using namespace mozilla::a11y;
|
||||||
@@ -59,7 +59,7 @@ nsWinUtils::MaybeStartWindowEmulation()
|
|||||||
// with tabs.
|
// with tabs.
|
||||||
if (Compatibility::IsJAWS() || Compatibility::IsWE() ||
|
if (Compatibility::IsJAWS() || Compatibility::IsWE() ||
|
||||||
Compatibility::IsDolphin() ||
|
Compatibility::IsDolphin() ||
|
||||||
BrowserTabsRemote()) {
|
XRE_GetProcessType() == GeckoProcessType_Content) {
|
||||||
RegisterNativeWindow(kClassNameTabContent);
|
RegisterNativeWindow(kClassNameTabContent);
|
||||||
sHWNDCache = new nsRefPtrHashtable<nsPtrHashKey<void>, DocAccessible>(4);
|
sHWNDCache = new nsRefPtrHashtable<nsPtrHashKey<void>, DocAccessible>(4);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -978,7 +978,16 @@ pref("dom.ipc.plugins.enabled.x86_64", true);
|
|||||||
pref("dom.ipc.plugins.enabled", true);
|
pref("dom.ipc.plugins.enabled", true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(NIGHTLY_BUILD) && defined(XP_MACOSX)
|
||||||
|
// In Nightly, browser.tabs.remote is enabled on platforms that
|
||||||
|
// support OMTC. 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);
|
pref("browser.tabs.remote", false);
|
||||||
|
#endif
|
||||||
|
pref("browser.tabs.remote.autostart", false);
|
||||||
|
|
||||||
// This pref governs whether we attempt to work around problems caused by
|
// This pref governs whether we attempt to work around problems caused by
|
||||||
// plugins using OS calls to manipulate the cursor while running out-of-
|
// plugins using OS calls to manipulate the cursor while running out-of-
|
||||||
|
|||||||
@@ -27,6 +27,14 @@
|
|||||||
accesskey="&newPrivateWindow.accesskey;"
|
accesskey="&newPrivateWindow.accesskey;"
|
||||||
command="Tools:PrivateBrowsing"
|
command="Tools:PrivateBrowsing"
|
||||||
key="key_privatebrowsing"/>
|
key="key_privatebrowsing"/>
|
||||||
|
<menuitem id="menu_newRemoteWindow"
|
||||||
|
label="New OOP Window"
|
||||||
|
hidden="true"
|
||||||
|
command="Tools:RemoteWindow"/>
|
||||||
|
<menuitem id="menu_newNonRemoteWindow"
|
||||||
|
label="New In-process Window"
|
||||||
|
hidden="true"
|
||||||
|
command="Tools:NonRemoteWindow"/>
|
||||||
<menuitem id="menu_openFile"
|
<menuitem id="menu_openFile"
|
||||||
label="&openFileCmd.label;"
|
label="&openFileCmd.label;"
|
||||||
command="Browser:OpenFile"
|
command="Browser:OpenFile"
|
||||||
|
|||||||
@@ -106,6 +106,10 @@
|
|||||||
oncommand="Cc['@mozilla.org/browser/browserglue;1'].getService(Ci.nsIBrowserGlue).sanitize(window);"/>
|
oncommand="Cc['@mozilla.org/browser/browserglue;1'].getService(Ci.nsIBrowserGlue).sanitize(window);"/>
|
||||||
<command id="Tools:PrivateBrowsing"
|
<command id="Tools:PrivateBrowsing"
|
||||||
oncommand="OpenBrowserWindow({private: true});"/>
|
oncommand="OpenBrowserWindow({private: true});"/>
|
||||||
|
<command id="Tools:RemoteWindow"
|
||||||
|
oncommand="OpenBrowserWindow({remote: true});"/>
|
||||||
|
<command id="Tools:NonRemoteWindow"
|
||||||
|
oncommand="OpenBrowserWindow({remote: false});"/>
|
||||||
<command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
|
<command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
|
||||||
<command id="History:UndoCloseWindow" oncommand="undoCloseWindow();"/>
|
<command id="History:UndoCloseWindow" oncommand="undoCloseWindow();"/>
|
||||||
<command id="Social:SharePage" oncommand="SocialShare.sharePage();" disabled="true"/>
|
<command id="Social:SharePage" oncommand="SocialShare.sharePage();" disabled="true"/>
|
||||||
|
|||||||
@@ -757,7 +757,11 @@ var gBrowserInit = {
|
|||||||
delayedStartupFinished: false,
|
delayedStartupFinished: false,
|
||||||
|
|
||||||
onLoad: function() {
|
onLoad: function() {
|
||||||
gMultiProcessBrowser = Services.appinfo.browserTabsRemote;
|
gMultiProcessBrowser =
|
||||||
|
window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||||
|
.getInterface(Ci.nsIWebNavigation)
|
||||||
|
.QueryInterface(Ci.nsILoadContext)
|
||||||
|
.useRemoteTabs;
|
||||||
|
|
||||||
var mustLoadSidebar = false;
|
var mustLoadSidebar = false;
|
||||||
|
|
||||||
@@ -1023,6 +1027,7 @@ var gBrowserInit = {
|
|||||||
IndexedDBPromptHelper.init();
|
IndexedDBPromptHelper.init();
|
||||||
gFormSubmitObserver.init();
|
gFormSubmitObserver.init();
|
||||||
SocialUI.init();
|
SocialUI.init();
|
||||||
|
gRemoteTabsUI.init();
|
||||||
|
|
||||||
// Initialize the full zoom setting.
|
// Initialize the full zoom setting.
|
||||||
// We do this before the session restore service gets initialized so we can
|
// We do this before the session restore service gets initialized so we can
|
||||||
@@ -3186,6 +3191,12 @@ function OpenBrowserWindow(options)
|
|||||||
extraFeatures = ",non-private";
|
extraFeatures = ",non-private";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options && options.remote) {
|
||||||
|
extraFeatures += ",remote";
|
||||||
|
} else if (options && options.remote === false) {
|
||||||
|
extraFeatures += ",non-remote";
|
||||||
|
}
|
||||||
|
|
||||||
// if and only if the current window is a browser window and it has a document with a character
|
// if and only if the current window is a browser window and it has a document with a character
|
||||||
// set, then extract the current charset menu setting from the current document and use it to
|
// set, then extract the current charset menu setting from the current document and use it to
|
||||||
// initialize the new browser window...
|
// initialize the new browser window...
|
||||||
@@ -6866,6 +6877,28 @@ let gPrivateBrowsingUI = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let gRemoteTabsUI = {
|
||||||
|
init: function() {
|
||||||
|
if (window.location.href != getBrowserURL()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let remoteTabs = gPrefService.getBoolPref("browser.tabs.remote");
|
||||||
|
let autostart = gPrefService.getBoolPref("browser.tabs.remote.autostart");
|
||||||
|
|
||||||
|
let newRemoteWindow = document.getElementById("menu_newRemoteWindow");
|
||||||
|
let newNonRemoteWindow = document.getElementById("menu_newNonRemoteWindow");
|
||||||
|
|
||||||
|
if (!remoteTabs) {
|
||||||
|
newRemoteWindow.hidden = true;
|
||||||
|
newNonRemoteWindow.hidden = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
newRemoteWindow.hidden = autostart;
|
||||||
|
newNonRemoteWindow.hidden = !autostart;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Switch to a tab that has a given URI, and focusses its browser window.
|
* Switch to a tab that has a given URI, and focusses its browser window.
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ addMessageListener("Browser:HideSessionRestoreButton", function (message) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Services.prefs.getBoolPref("browser.tabs.remote")) {
|
if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
|
||||||
addEventListener("contextmenu", function (event) {
|
addEventListener("contextmenu", function (event) {
|
||||||
sendAsyncMessage("contextmenu", {}, { event: event });
|
sendAsyncMessage("contextmenu", {}, { event: event });
|
||||||
}, false);
|
}, false);
|
||||||
|
|||||||
@@ -3054,7 +3054,11 @@
|
|||||||
"-moz-default-background-color" :
|
"-moz-default-background-color" :
|
||||||
Services.prefs.getCharPref("browser.display.background_color");
|
Services.prefs.getCharPref("browser.display.background_color");
|
||||||
|
|
||||||
if (Services.appinfo.browserTabsRemote) {
|
let remote = window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||||
|
.getInterface(Ci.nsIWebNavigation)
|
||||||
|
.QueryInterface(Ci.nsILoadContext)
|
||||||
|
.useRemoteTabs;
|
||||||
|
if (remote) {
|
||||||
messageManager.addMessageListener("DOMTitleChanged", this);
|
messageManager.addMessageListener("DOMTitleChanged", this);
|
||||||
messageManager.addMessageListener("contextmenu", this);
|
messageManager.addMessageListener("contextmenu", this);
|
||||||
}
|
}
|
||||||
@@ -3121,7 +3125,7 @@
|
|||||||
document.removeEventListener("keypress", this, false);
|
document.removeEventListener("keypress", this, false);
|
||||||
window.removeEventListener("sizemodechange", this, false);
|
window.removeEventListener("sizemodechange", this, false);
|
||||||
|
|
||||||
if (Services.appinfo.browserTabsRemote) {
|
if (gMultiProcessBrowser) {
|
||||||
messageManager.removeMessageListener("DOMTitleChanged", this);
|
messageManager.removeMessageListener("DOMTitleChanged", this);
|
||||||
messageManager.removeMessageListener("contextmenu", this);
|
messageManager.removeMessageListener("contextmenu", this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2258,6 +2258,13 @@ nsDocShell::GetUseRemoteTabs(bool* aUseRemoteTabs)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDocShell::SetRemoteTabs(bool aUseRemoteTabs)
|
nsDocShell::SetRemoteTabs(bool aUseRemoteTabs)
|
||||||
{
|
{
|
||||||
|
#ifdef MOZ_CRASHREPORTER
|
||||||
|
if (aUseRemoteTabs) {
|
||||||
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("DOMIPCEnabled"),
|
||||||
|
NS_LITERAL_CSTRING("1"));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
mUseRemoteTabs = aUseRemoteTabs;
|
mUseRemoteTabs = aUseRemoteTabs;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ this.OnRefTestLoad = function OnRefTestLoad(win)
|
|||||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
||||||
getService(Components.interfaces.nsIPrefBranch);
|
getService(Components.interfaces.nsIPrefBranch);
|
||||||
try {
|
try {
|
||||||
gBrowserIsRemote = prefs.getBoolPref("browser.tabs.remote");
|
gBrowserIsRemote = prefs.getBoolPref("browser.tabs.remote.autostart");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
gBrowserIsRemote = false;
|
gBrowserIsRemote = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -582,6 +582,7 @@ class Mochitest(MochitestUtilsMixin):
|
|||||||
if options.browserChrome and options.timeout:
|
if options.browserChrome and options.timeout:
|
||||||
options.extraPrefs.append("testing.browserTestHarness.timeout=%d" % 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=%s" % ('true' if options.e10s else 'false'))
|
||||||
|
options.extraPrefs.append("browser.tabs.remote.autostart=%s" % ('true' if options.e10s else 'false'))
|
||||||
|
|
||||||
# get extensions to install
|
# get extensions to install
|
||||||
extensions = self.getExtensionsToInstall(options)
|
extensions = self.getExtensionsToInstall(options)
|
||||||
|
|||||||
@@ -203,10 +203,10 @@ RUN_REFTEST_B2G = rm -f ./$@.log && $(PYTHON) _tests/reftest/runreftestb2g.py \
|
|||||||
|
|
||||||
ifeq ($(OS_ARCH),WINNT) #{
|
ifeq ($(OS_ARCH),WINNT) #{
|
||||||
# GPU-rendered shadow layers are unsupported here
|
# GPU-rendered shadow layers are unsupported here
|
||||||
OOP_CONTENT = --setpref=browser.tabs.remote=true --setpref=layers.acceleration.disabled=true
|
OOP_CONTENT = --setpref=browser.tabs.remote=true --setpref=browser.tabs.remote.autostart=true --setpref=layers.acceleration.disabled=true
|
||||||
GPU_RENDERING =
|
GPU_RENDERING =
|
||||||
else
|
else
|
||||||
OOP_CONTENT = --setpref=browser.tabs.remote=true
|
OOP_CONTENT = --setpref=browser.tabs.remote=true --setpref=browser.tabs.remote.autostart=true
|
||||||
GPU_RENDERING = --setpref=layers.acceleration.force-enabled=true
|
GPU_RENDERING = --setpref=layers.acceleration.force-enabled=true
|
||||||
endif #}
|
endif #}
|
||||||
|
|
||||||
|
|||||||
@@ -3846,11 +3846,6 @@ XREMain::XRE_mainRun()
|
|||||||
mDirProvider.DoStartup();
|
mDirProvider.DoStartup();
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
#ifdef MOZ_CRASHREPORTER
|
||||||
if (BrowserTabsRemote()) {
|
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("DOMIPCEnabled"),
|
|
||||||
NS_LITERAL_CSTRING("1"));
|
|
||||||
}
|
|
||||||
|
|
||||||
nsCString userAgentLocale;
|
nsCString userAgentLocale;
|
||||||
if (NS_SUCCEEDED(Preferences::GetCString("general.useragent.locale", &userAgentLocale))) {
|
if (NS_SUCCEEDED(Preferences::GetCString("general.useragent.locale", &userAgentLocale))) {
|
||||||
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("useragent_locale"), userAgentLocale);
|
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("useragent_locale"), userAgentLocale);
|
||||||
|
|||||||
Reference in New Issue
Block a user