Skip to content

Commit

Permalink
merge mozilla-inbound to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Feb 11, 2015
2 parents bbffc0b + 196d9fe commit 1da4eb2
Show file tree
Hide file tree
Showing 272 changed files with 5,810 additions and 3,264 deletions.
2 changes: 1 addition & 1 deletion b2g/app/b2g.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ pref("media.fragmented-mp4.gonk.enabled", true);
pref("media.video-queue.default-size", 3);

// optimize images' memory usage
pref("image.mem.decodeondraw", false);
pref("image.mem.decodeondraw", true);
pref("image.mem.allow_locking_in_content_processes", false); /* don't allow image locking */
// Limit the surface cache to 1/8 of main memory or 128MB, whichever is smaller.
// Almost everything that was factored into 'max_decoded_image_kb' is now stored
Expand Down
8 changes: 7 additions & 1 deletion browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1651,9 +1651,15 @@ pref("pdfjs.firstRun", true);
pref("pdfjs.previousHandler.preferredAction", 0);
pref("pdfjs.previousHandler.alwaysAskBeforeHandling", false);

// Shumway is only bundled in Nightly.
#ifdef NIGHTLY_BUILD
// Shumway component (SWF player) is disabled by default. Also see bug 904346.
// By default, Shumway (SWF player) is only enabled for whitelisted SWFs on Windows + OS X.
#ifdef UNIX_BUT_NOT_MAC
pref("shumway.disabled", true);
#else
pref("shumway.disabled", false);
pref("shumway.swf.whitelist", "http://g-ecx.images-amazon.com/*/AiryBasicRenderer*.swf");
#endif
#endif

// The maximum amount of decoded image data we'll willingly keep around (we
Expand Down
75 changes: 67 additions & 8 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,22 @@ function LoadInOtherProcess(browser, loadOptions, historyIndex = -1) {
// Called when a docshell has attempted to load a page in an incorrect process.
// This function is responsible for loading the page in the correct process.
function RedirectLoad({ target: browser, data }) {
LoadInOtherProcess(browser, data.loadOptions, data.historyIndex);
// We should only start the redirection if the browser window has finished
// starting up. Otherwise, we should wait until the startup is done.
if (gBrowserInit.delayedStartupFinished) {
LoadInOtherProcess(browser, data.loadOptions, data.historyIndex);
} else {
let delayedStartupFinished = (subject, topic) => {
if (topic == "browser-delayed-startup-finished" &&
subject == window) {
Services.obs.removeObserver(delayedStartupFinished, topic);
LoadInOtherProcess(browser, data.loadOptions, data.historyIndex);
}
};
Services.obs.addObserver(delayedStartupFinished,
"browser-delayed-startup-finished",
false);
}
}

var gBrowserInit = {
Expand Down Expand Up @@ -906,6 +921,8 @@ var gBrowserInit = {
mm.loadFrameScript("chrome://browser/content/content.js", true);
mm.loadFrameScript("chrome://browser/content/content-UITour.js", true);

window.messageManager.addMessageListener("Browser:LoadURI", RedirectLoad);

// initialize observers and listeners
// and give C++ access to gBrowser
XULBrowserWindow.init();
Expand All @@ -923,8 +940,6 @@ var gBrowserInit = {
Cc["@mozilla.org/eventlistenerservice;1"]
.getService(Ci.nsIEventListenerService)
.addSystemEventListener(gBrowser, "click", contentAreaClick, true);
} else {
gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, true);
}

// hook up UI through progress listener
Expand Down Expand Up @@ -1181,13 +1196,29 @@ var gBrowserInit = {
else if (uriToLoad instanceof XULElement) {
// swap the given tab with the default about:blank tab and then close
// the original tab in the other window.
let tabToOpen = uriToLoad;

// Stop the about:blank load
gBrowser.stop();
// make sure it has a docshell
gBrowser.docShell;

gBrowser.swapBrowsersAndCloseOther(gBrowser.selectedTab, uriToLoad);
// If the browser that we're swapping in was remote, then we'd better
// be able to support remote browsers, and then make our selectedTab
// remote.
try {
if (tabToOpen.linkedBrowser.isRemoteBrowser) {
if (!gMultiProcessBrowser) {
throw new Error("Cannot drag a remote browser into a window " +
"without the remote tabs load context.");
}

gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, true);
}
gBrowser.swapBrowsersAndCloseOther(gBrowser.selectedTab, tabToOpen);
} catch(e) {
Cu.reportError(e);
}
}
// window.arguments[2]: referrer (nsIURI)
// [3]: postData (nsIInputStream)
Expand Down Expand Up @@ -1216,7 +1247,6 @@ var gBrowserInit = {
Services.obs.addObserver(gXPInstallObserver, "addon-install-failed", false);
Services.obs.addObserver(gXPInstallObserver, "addon-install-complete", false);
window.messageManager.addMessageListener("Browser:URIFixup", gKeywordURIFixup);
window.messageManager.addMessageListener("Browser:LoadURI", RedirectLoad);

BrowserOffline.init();
OfflineApps.init();
Expand Down Expand Up @@ -4082,6 +4112,13 @@ var XULBrowserWindow = {
// unsupported
},

forceInitialBrowserRemote: function() {
let initBrowser =
document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser");
gBrowser.updateBrowserRemoteness(initBrowser, true);
return initBrowser.frameLoader.tabParent;
},

setDefaultStatus: function (status) {
this.defaultStatus = status;
this.updateStatusField();
Expand Down Expand Up @@ -4737,7 +4774,7 @@ function nsBrowserAccess() { }
nsBrowserAccess.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserDOMWindow, Ci.nsISupports]),

_openURIInNewTab: function(aURI, aReferrer, aIsPrivate, aIsExternal) {
_openURIInNewTab: function(aURI, aReferrer, aIsPrivate, aIsExternal, aForceNotRemote=false) {
let win, needToFocusWin;

// try the current window. if we're in a popup, fall back on the most recent browser window
Expand All @@ -4764,7 +4801,8 @@ nsBrowserAccess.prototype = {
let tab = win.gBrowser.loadOneTab(aURI ? aURI.spec : "about:blank", {
referrerURI: aReferrer,
fromExternal: aIsExternal,
inBackground: loadInBackground});
inBackground: loadInBackground,
forceNotRemote: aForceNotRemote});
let browser = win.gBrowser.getBrowserForTab(tab);

if (needToFocusWin || (!loadInBackground && aIsExternal))
Expand All @@ -4774,9 +4812,23 @@ nsBrowserAccess.prototype = {
},

openURI: function (aURI, aOpener, aWhere, aContext) {
// This function should only ever be called if we're opening a URI
// from a non-remote browser window (via nsContentTreeOwner).
if (aOpener && Cu.isCrossProcessWrapper(aOpener)) {
Cu.reportError("nsBrowserAccess.openURI was passed a CPOW for aOpener. " +
"openURI should only ever be called from non-remote browsers.");
throw Cr.NS_ERROR_FAILURE;
}

var newWindow = null;
var isExternal = (aContext == Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);

if (aOpener && isExternal) {
Cu.reportError("nsBrowserAccess.openURI did not expect an opener to be " +
"passed if the context is OPEN_EXTERNAL.");
throw Cr.NS_ERROR_FAILURE;
}

if (isExternal && aURI && aURI.schemeIs("chrome")) {
dump("use --chrome command-line option to load external chrome urls\n");
return null;
Expand Down Expand Up @@ -4805,7 +4857,14 @@ nsBrowserAccess.prototype = {
break;
case Ci.nsIBrowserDOMWindow.OPEN_NEWTAB :
let referrer = aOpener ? makeURI(aOpener.location.href) : null;
let browser = this._openURIInNewTab(aURI, referrer, isPrivate, isExternal);
// If we have an opener, that means that the caller is expecting access
// to the nsIDOMWindow of the opened tab right away. For e10s windows,
// this means forcing the newly opened browser to be non-remote so that
// we can hand back the nsIDOMWindow. The XULBrowserWindow.shouldLoadURI
// will do the job of shuttling off the newly opened browser to run in
// the right process once it starts loading a URI.
let forceNotRemote = !!aOpener;
let browser = this._openURIInNewTab(aURI, referrer, isPrivate, isExternal, forceNotRemote);
if (browser)
newWindow = browser.contentWindow;
break;
Expand Down
6 changes: 4 additions & 2 deletions browser/base/content/nsContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,9 @@ nsContextMenu.prototype = {
}

// BiDi UI
this.showItem("context-sep-bidi", top.gBidiUI);
this.showItem("context-sep-bidi", !this.onNumeric && top.gBidiUI);
this.showItem("context-bidi-text-direction-toggle",
this.onTextInput && top.gBidiUI);
this.onTextInput && !this.onNumeric && top.gBidiUI);
this.showItem("context-bidi-page-direction-toggle",
!this.onTextInput && top.gBidiUI);

Expand Down Expand Up @@ -563,6 +563,7 @@ nsContextMenu.prototype = {
this.onVideo = false;
this.onAudio = false;
this.onTextInput = false;
this.onNumeric = false;
this.onKeywordField = false;
this.mediaURL = "";
this.onLink = false;
Expand Down Expand Up @@ -658,6 +659,7 @@ nsContextMenu.prototype = {
}
else if (editFlags & (SpellCheckHelper.INPUT | SpellCheckHelper.TEXTAREA)) {
this.onTextInput = (editFlags & SpellCheckHelper.TEXTINPUT) !== 0;
this.onNumeric = (editFlags & SpellCheckHelper.NUMERIC) !== 0;
this.onEditableArea = (editFlags & SpellCheckHelper.EDITABLE) !== 0;
if (this.onEditableArea) {
if (this.isRemote) {
Expand Down
8 changes: 7 additions & 1 deletion browser/base/content/tabbrowser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,7 @@
var aRelatedToCurrent;
var aAllowMixedContent;
var aSkipAnimation;
var aForceNotRemote;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
Expand All @@ -1379,6 +1380,7 @@
aRelatedToCurrent = params.relatedToCurrent;
aAllowMixedContent = params.allowMixedContent;
aSkipAnimation = params.skipAnimation;
aForceNotRemote = params.forceNotRemote;
}
var bgLoad = (aLoadInBackground != null) ? aLoadInBackground :
Expand All @@ -1393,7 +1395,8 @@
fromExternal: aFromExternal,
relatedToCurrent: aRelatedToCurrent,
skipAnimation: aSkipAnimation,
allowMixedContent: aAllowMixedContent });
allowMixedContent: aAllowMixedContent,
forceNotRemote: aForceNotRemote });
if (!bgLoad)
this.selectedTab = tab;
Expand Down Expand Up @@ -1672,6 +1675,7 @@
var aRelatedToCurrent;
var aSkipAnimation;
var aAllowMixedContent;
var aForceNotRemote;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
Expand All @@ -1685,6 +1689,7 @@
aRelatedToCurrent = params.relatedToCurrent;
aSkipAnimation = params.skipAnimation;
aAllowMixedContent = params.allowMixedContent;
aForceNotRemote = params.forceNotRemote;
}
// if we're adding tabs, we're past interrupt mode, ditch the owner
Expand All @@ -1702,6 +1707,7 @@
// The new browser should be remote if this is an e10s window and
// the uri to load can be loaded remotely.
let remote = gMultiProcessBrowser &&
!aForceNotRemote &&
E10SUtils.canLoadURIInProcess(aURI, Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT);
if (remote)
t.setAttribute("remote", "true");
Expand Down
6 changes: 3 additions & 3 deletions browser/base/content/test/general/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ skip-if = e10s
[browser_bug561636.js]
skip-if = e10s # Bug 1093677 - automated form submission from the test doesn't seem to quite work yet
[browser_bug562649.js]
skip-if = e10s # Bug 940195 - XULBrowserWindow.isBusy is false as a remote tab starts loading
[browser_bug563588.js]
[browser_bug565575.js]
skip-if = e10s
Expand Down Expand Up @@ -260,15 +259,13 @@ skip-if = buildapp == 'mulet' || os == "mac" # mac: Intermittent failures, bug 9
[browser_bug678392.js]
skip-if = e10s # bug 1102331 - does focus things on the content window which break in e10s mode
[browser_bug710878.js]
skip-if = e10s # Bug 1100653 - test uses waitForFocus on content
[browser_bug719271.js]
skip-if = e10s # Bug 1056146 - zoom tests use FullZoomHelper and break in e10s
[browser_bug724239.js]
[browser_bug734076.js]
skip-if = e10s # Bug 1093155 - tries to use context menu from browser-chrome and gets in a mess when in e10s mode
[browser_bug735471.js]
[browser_bug749738.js]
skip-if = e10s # Bug 921935 - focusmanager issues with e10s
[browser_bug763468_perwindowpb.js]
skip-if = e10s
[browser_bug767836_perwindowpb.js]
Expand All @@ -279,6 +276,7 @@ skip-if = e10s
[browser_bug832435.js]
[browser_bug839103.js]
[browser_bug880101.js]
skip-if = e10s # Bug 1126316 - New e10s windows erroneously fire initial about:blank location through nsIWebProgressListener
[browser_bug882977.js]
[browser_bug902156.js]
[browser_bug906190.js]
Expand Down Expand Up @@ -427,6 +425,8 @@ skip-if = e10s
[browser_tabs_isActive.js]
skip-if = e10s # Bug 1100664 - test relies on linkedBrowser.docShell
[browser_tabs_owner.js]
[browser_testOpenNewRemoteTabsFromNonRemoteBrowsers.js]
skip-if = !e10s && os == "linux" # Bug 994541 - Need OMTC enabled by default on Linux, or else we get blocked by an alert dialog when opening e10s window.
[browser_trackingUI.js]
support-files =
trackingPage.html
Expand Down
1 change: 0 additions & 1 deletion browser/base/content/test/general/browser_bug562649.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ function test() {
Ci.nsIBrowserDOMWindow.OPEN_NEWTAB,
Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);

ok(XULBrowserWindow.isBusy, "window is busy loading a page");
is(gBrowser.userTypedValue, URI, "userTypedValue matches test URI");
is(gURLBar.value, URI, "location bar value matches test URI");

Expand Down
Loading

0 comments on commit 1da4eb2

Please sign in to comment.