Skip to content

Commit

Permalink
Bug 1383876 - Part 2: Remove GroupedSHistory and Prerendering logic f…
Browse files Browse the repository at this point in the history
…rom JS code, r=freesamael

MozReview-Commit-ID: KwvOcgQKheK
  • Loading branch information
mystor committed Jan 12, 2018
1 parent a0d1f16 commit e0822be
Show file tree
Hide file tree
Showing 28 changed files with 4 additions and 1,788 deletions.
91 changes: 1 addition & 90 deletions browser/base/content/tabbrowser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1732,7 +1732,6 @@
var aOriginPrincipal;
var aOpener;
var aOpenerBrowser;
var aIsPrerendered;
var aCreateLazyBrowser;
var aNextTabParentId;
var aFocusUrlBar;
Expand Down Expand Up @@ -1760,7 +1759,6 @@
aOriginPrincipal = params.originPrincipal;
aOpener = params.opener;
aOpenerBrowser = params.openerBrowser;
aIsPrerendered = params.isPrerendered;
aCreateLazyBrowser = params.createLazyBrowser;
aNextTabParentId = params.nextTabParentId;
aFocusUrlBar = params.focusUrlBar;
Expand Down Expand Up @@ -1792,7 +1790,6 @@
sameProcessAsFrameLoader: aSameProcessAsFrameLoader,
opener: aOpener,
openerBrowser: aOpenerBrowser,
isPrerendered: aIsPrerendered,
nextTabParentId: aNextTabParentId,
focusUrlBar: aFocusUrlBar,
name: aName });
Expand Down Expand Up @@ -2201,7 +2198,7 @@
<![CDATA[
// Supported parameters:
// userContextId, remote, remoteType, isPreloadBrowser,
// uriIsAboutBlank, sameProcessAsFrameLoader, isPrerendered
// uriIsAboutBlank, sameProcessAsFrameLoader
const NS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
Expand All @@ -2213,10 +2210,6 @@
b.setAttribute("contextmenu", this.getAttribute("contentcontextmenu"));
b.setAttribute("tooltip", this.getAttribute("contenttooltip"));
if (aParams.isPrerendered) {
b.setAttribute("prerendered", "true");
}
if (aParams.userContextId) {
b.setAttribute("usercontextid", aParams.userContextId);
}
Expand Down Expand Up @@ -2605,7 +2598,6 @@
var aDisallowInheritPrincipal;
var aOpener;
var aOpenerBrowser;
var aIsPrerendered;
var aCreateLazyBrowser;
var aSkipBackgroundNotify;
var aNextTabParentId;
Expand Down Expand Up @@ -2637,7 +2629,6 @@
aDisallowInheritPrincipal = params.disallowInheritPrincipal;
aOpener = params.opener;
aOpenerBrowser = params.openerBrowser;
aIsPrerendered = params.isPrerendered;
aCreateLazyBrowser = params.createLazyBrowser;
aSkipBackgroundNotify = params.skipBackgroundNotify;
aNextTabParentId = params.nextTabParentId;
Expand Down Expand Up @@ -2695,10 +2686,6 @@
}
}
if (aIsPrerendered) {
t.setAttribute("hidden", "true");
}
// Related tab inherits current tab's user context unless a different
// usercontextid is specified
if (aUserContextId == null && openerTab) {
Expand Down Expand Up @@ -2795,7 +2782,6 @@
userContextId: aUserContextId,
sameProcessAsFrameLoader: aSameProcessAsFrameLoader,
openerWindow: aOpener,
isPrerendered: aIsPrerendered,
nextTabParentId: aNextTabParentId,
name: aName });
}
Expand Down Expand Up @@ -5824,76 +5810,6 @@
}
break;
}
case "Prerender:Request": {
let sendCancelPrerendering = () => {
browser.frameloader.messageManager.
sendAsyncMessage("Prerender:Canceled", { id: data.id });
};
let tab = this.getTabForBrowser(browser);
if (!tab) {
// No tab?
sendCancelPrerendering();
break;
}
if (tab.hidden) {
// Skip prerender on hidden tab.
sendCancelPrerendering();
break;
}
if (browser.canGoForward) {
// Skip prerender on history navigation as we don't support it
// yet. Remove this check once bug 1323650 is implemented.
sendCancelPrerendering();
break;
}
if (!data.href) {
// If we don't have data.href, loadOneTab will load about:blank
// which is meaningless for prerendering.
sendCancelPrerendering();
break;
}
let groupedSHistory = browser.frameLoader.ensureGroupedSHistory();
let newTab = this.loadOneTab(data.href, {
referrerURI: (data.referrer ? makeURI(data.referrer) : null),
referrerPolicy: Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
postData: null,
allowThirdPartyFixup: true,
relatedToCurrent: true,
isPrerendered: true,
triggeringPrincipal: Utils.deserializePrincipal(data.triggeringPrincipal),
});
let partialSHistory = newTab.linkedBrowser.frameLoader.partialSHistory;
groupedSHistory.addPrerenderingPartialSHistory(partialSHistory, data.id);
break;
}
case "Prerender:Cancel": {
let groupedSHistory = browser.frameLoader.groupedSHistory;
if (groupedSHistory) {
groupedSHistory.cancelPrerendering(data.id);
}
break;
}
case "Prerender:Swap": {
let frameloader = browser.frameLoader;
let groupedSHistory = browser.frameLoader.groupedSHistory;
if (groupedSHistory) {
groupedSHistory.activatePrerendering(data.id).then(
() => frameloader.messageManager.sendAsyncMessage("Prerender:Swapped", data),
() => frameloader.messageManager.sendAsyncMessage("Prerender:Canceled", data),
);
}
break;
}
}
return undefined;
]]></body>
Expand Down Expand Up @@ -6060,11 +5976,6 @@
Services.prefs.addObserver("accessibility.typeaheadfind", this);
messageManager.addMessageListener("Findbar:Keypress", this);
// Add listeners for prerender messages
messageManager.addMessageListener("Prerender:Request", this);
messageManager.addMessageListener("Prerender:Cancel", this);
messageManager.addMessageListener("Prerender:Swap", this);
XPCOMUtils.defineLazyPreferenceGetter(this, "animationsEnabled",
"toolkit.cosmeticAnimations.enabled", true);
XPCOMUtils.defineLazyPreferenceGetter(this, "schedulePressureDefaultCount",
Expand Down
3 changes: 0 additions & 3 deletions browser/base/content/test/general/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,3 @@ skip-if = (os == "linux" && !e10s) # Bug 1263254 - Perma fails on Linux without
# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
[browser_bug1299667.js]
# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
[browser_close_dependent_tabs.js]
skip-if = !e10s # GroupedSHistory is e10s-only
# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
78 changes: 0 additions & 78 deletions browser/base/content/test/general/browser_close_dependent_tabs.js

This file was deleted.

6 changes: 1 addition & 5 deletions browser/components/sessionstore/SessionStore.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -3898,11 +3898,7 @@ var SessionStoreInternal = {

this.markTabAsRestoring(aTab);

// We need a new frameloader if we are reloading into a browser with a
// grouped session history (as we don't support restoring into browsers
// with grouped session histories directly).
let newFrameloader =
aOptions.newFrameloader || !!browser.frameLoader.groupedSHistory;
let newFrameloader = aOptions.newFrameloader;

let isRemotenessUpdate;
if (aOptions.remoteType !== undefined) {
Expand Down
10 changes: 1 addition & 9 deletions browser/components/sessionstore/content/content-sessionStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,7 @@ var MessageListener = {
break;
case "SessionStore:becomeActiveProcess":
let shistory = docShell.QueryInterface(Ci.nsIWebNavigation).sessionHistory;
// Check if we are at the end of the current session history, if we are,
// it is safe for us to collect and transmit our session history, so
// transmit all of it. Otherwise, we only want to transmit our index changes,
// so collect from kLastIndex.
if (shistory.globalCount - shistory.globalIndexOffset == shistory.count) {
SessionHistoryListener.collect();
} else {
SessionHistoryListener.collectFrom(kLastIndex);
}
SessionHistoryListener.collect();
break;
default:
debug("received unknown message '" + name + "'");
Expand Down
2 changes: 0 additions & 2 deletions browser/components/sessionstore/test/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,6 @@ run-if = e10s && crashreporter
[browser_undoCloseById.js]
skip-if = debug
[browser_docshell_uuid_consistency.js]
[browser_grouped_session_store.js]
skip-if = !e10s # GroupedSHistory is e10s-only

[browser_closed_objects_changed_notifications_tabs.js]
[browser_closed_objects_changed_notifications_windows.js]
Expand Down
Loading

0 comments on commit e0822be

Please sign in to comment.