mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 666804 - [e10s] Support NetworkPrioritizer (r=felipe)
This commit is contained in:
parent
0245244bfd
commit
96f886f1cf
@ -1093,12 +1093,9 @@ var gBrowserInit = {
|
||||
if (!getBoolPref("ui.click_hold_context_menus", false))
|
||||
SetClickAndHoldHandlers();
|
||||
|
||||
// Bug 666804 - NetworkPrioritizer support for e10s
|
||||
if (!gMultiProcessBrowser) {
|
||||
let NP = {};
|
||||
Cu.import("resource:///modules/NetworkPrioritizer.jsm", NP);
|
||||
NP.trackBrowserWindow(window);
|
||||
}
|
||||
let NP = {};
|
||||
Cu.import("resource:///modules/NetworkPrioritizer.jsm", NP);
|
||||
NP.trackBrowserWindow(window);
|
||||
|
||||
PlacesToolbarHelper.init();
|
||||
|
||||
|
@ -80,18 +80,12 @@ let BrowserHelper = {
|
||||
windowEntry.lastSelectedBrowser = aBrowser;
|
||||
},
|
||||
|
||||
// Auxiliary methods
|
||||
getLoadgroup: function NP_BH_getLoadgroup(aBrowser) {
|
||||
return aBrowser.webNavigation.QueryInterface(Ci.nsIDocumentLoader)
|
||||
.loadGroup.QueryInterface(Ci.nsISupportsPriority);
|
||||
},
|
||||
|
||||
increasePriority: function NP_BH_increasePriority(aBrowser) {
|
||||
this.getLoadgroup(aBrowser).adjustPriority(PRIORITY_DELTA);
|
||||
aBrowser.adjustPriority(PRIORITY_DELTA);
|
||||
},
|
||||
|
||||
decreasePriority: function NP_BH_decreasePriority(aBrowser) {
|
||||
this.getLoadgroup(aBrowser).adjustPriority(PRIORITY_DELTA * -1);
|
||||
aBrowser.adjustPriority(PRIORITY_DELTA * -1);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -286,6 +286,13 @@ addMessageListener("History:UseGlobalHistory", function (aMessage) {
|
||||
docShell.useGlobalHistory = aMessage.data.enabled;
|
||||
});
|
||||
|
||||
addMessageListener("NetworkPrioritizer:AdjustPriority", (msg) => {
|
||||
let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
|
||||
let loadGroup = webNav.QueryInterface(Ci.nsIDocumentLoader)
|
||||
.loadGroup.QueryInterface(Ci.nsISupportsPriority);
|
||||
loadGroup.adjustPriority(msg.data.adjustment);
|
||||
});
|
||||
|
||||
let AutoCompletePopup = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompletePopup]),
|
||||
|
||||
|
@ -674,6 +674,15 @@
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<method name="adjustPriority">
|
||||
<parameter name="adjustment"/>
|
||||
<body><![CDATA[
|
||||
let loadGroup = this.webNavigation.QueryInterface(Ci.nsIDocumentLoader)
|
||||
.loadGroup.QueryInterface(Ci.nsISupportsPriority);
|
||||
loadGroup.adjustPriority(adjustment);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<!--
|
||||
This field tracks the location bar state. The value that the user typed
|
||||
in to the location bar may not be changed while this field is zero.
|
||||
|
@ -31,6 +31,14 @@
|
||||
]]></getter>
|
||||
</property>
|
||||
|
||||
<method name="adjustPriority">
|
||||
<parameter name="adjustment"/>
|
||||
<body><![CDATA[
|
||||
this.messageManager.sendAsyncMessage("NetworkPrioritizer:AdjustPriority",
|
||||
{adjustment: adjustment});
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<field name="_remoteWebNavigation">null</field>
|
||||
|
||||
<property name="webNavigation"
|
||||
|
Loading…
Reference in New Issue
Block a user