mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Bug 923333 - Replace docShell.setCurrentURI with something e10s-compatible (r=felipe)
This commit is contained in:
parent
a3daa9a2dd
commit
9b2f6cf9da
@ -206,6 +206,19 @@
|
||||
onget="return this.webNavigation.currentURI;"
|
||||
readonly="true"/>
|
||||
|
||||
<!--
|
||||
Used by session restore to ensure that currentURI is set so
|
||||
that switch-to-tab works before the tab is fully
|
||||
restored. This function also invokes onLocationChanged
|
||||
listeners in tabbrowser.xml.
|
||||
-->
|
||||
<method name="_setCurrentURI">
|
||||
<parameter name="aURI"/>
|
||||
<body><![CDATA[
|
||||
this.docShell.setCurrentURI(aURI);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<property name="documentURI"
|
||||
onget="return this.contentDocument.documentURIObject;"
|
||||
readonly="true"/>
|
||||
|
@ -45,8 +45,8 @@
|
||||
if (!this._remoteWebProgress) {
|
||||
let jsm = "resource://gre/modules/RemoteWebProgress.jsm";
|
||||
let RemoteWebProgressManager = Cu.import(jsm, {}).RemoteWebProgressManager;
|
||||
this._remoteWebProgress = new RemoteWebProgressManager(this)
|
||||
.topLevelWebProgress;
|
||||
this._remoteWebProgressManager = new RemoteWebProgressManager(this);
|
||||
this._remoteWebProgress = this._remoteWebProgressManager.topLevelWebProgress;
|
||||
}
|
||||
return this._remoteWebProgress;
|
||||
]]>
|
||||
@ -68,6 +68,19 @@
|
||||
|
||||
<field name="_documentURI">null</field>
|
||||
|
||||
<!--
|
||||
Used by session restore to ensure that currentURI is set so
|
||||
that switch-to-tab works before the tab is fully
|
||||
restored. This function also invokes onLocationChanged
|
||||
listeners in tabbrowser.xml.
|
||||
-->
|
||||
<method name="_setCurrentURI">
|
||||
<parameter name="aURI"/>
|
||||
<body><![CDATA[
|
||||
this._remoteWebProgressManager.setCurrentURI(aURI);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<property name="documentURI"
|
||||
onget="return this._documentURI;"
|
||||
readonly="true"/>
|
||||
|
@ -109,6 +109,18 @@ RemoteWebProgressManager.prototype = {
|
||||
return [deserialized, aState];
|
||||
},
|
||||
|
||||
setCurrentURI: function (aURI) {
|
||||
// This function is simpler than nsDocShell::SetCurrentURI since
|
||||
// it doesn't have to deal with child docshells.
|
||||
let webNavigation = this._browser.webNavigation;
|
||||
webNavigation._currentURI = aURI;
|
||||
|
||||
let webProgress = this.topLevelWebProgress;
|
||||
for (let p of this._progressListeners) {
|
||||
p.onLocationChange(webProgress, null, aURI);
|
||||
}
|
||||
},
|
||||
|
||||
_callProgressListeners: function(methodName, ...args) {
|
||||
for (let p of this._progressListeners) {
|
||||
if (p[methodName]) {
|
||||
|
Loading…
Reference in New Issue
Block a user