Bug 923333 - Replace docShell.setCurrentURI with something e10s-compatible (r=felipe)

This commit is contained in:
Bill McCloskey 2013-11-12 15:02:14 -08:00
parent a7f8d65586
commit da1234b0aa
3 changed files with 40 additions and 2 deletions

View File

@ -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"/>

View File

@ -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"/>

View File

@ -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]) {