зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1166351 - Add instrumentation to try to figure out why tabbrowser-remote-browser binding is sometimes removed. r=felipe.
--HG-- extra : commitid : 1s4eJ2vMO1W extra : rebase_source : 891fb1234554dac25b9aeadb16e749e284dfaf80 extra : amend_source : e0ce278be8277fcd892c5aea300a58df2cfd65de
This commit is contained in:
Родитель
d5200e32c3
Коммит
aaf0b00113
|
@ -3371,6 +3371,16 @@
|
|||
return;
|
||||
}
|
||||
|
||||
// Instrumentation to figure out bug 1166351 - if the binding
|
||||
// on the browser we're switching to has gone away, try to find out
|
||||
// why. We should remove this and the checkBrowserBindingAlive
|
||||
// method once bug 1166351 has been closed.
|
||||
if (this.tabbrowser.AppConstants.E10S_TESTING_ONLY &&
|
||||
!this.checkBrowserBindingAlive(tab)) {
|
||||
Cu.reportError("Please report the above errors in bug 1166351.");
|
||||
return;
|
||||
}
|
||||
|
||||
this.logState("requestTab " + this.tinfo(tab));
|
||||
this.startTabSwitch();
|
||||
|
||||
|
@ -3466,6 +3476,40 @@
|
|||
return this._shouldLog;
|
||||
},
|
||||
|
||||
// Instrumentation for bug 1166351
|
||||
checkBrowserBindingAlive: function(tab) {
|
||||
let err = Cu.reportError;
|
||||
|
||||
if (!tab.linkedBrowser) {
|
||||
err("Attempting to switch to tab that has no linkedBrowser.");
|
||||
return false;
|
||||
}
|
||||
|
||||
let b = tab.linkedBrowser;
|
||||
|
||||
if (!b.isRemoteBrowser) {
|
||||
// non-remote browsers are not the problem.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!b._alive) {
|
||||
// The browser binding has been removed. Dump a bunch of
|
||||
// diagnostic information to the browser console.
|
||||
err("The tabbrowser-remote-browser binding has been removed " +
|
||||
"from the tab being switched to.");
|
||||
err("MozBinding is currently: " +
|
||||
window.getComputedStyle(b).MozBinding);
|
||||
if (!b.parentNode) {
|
||||
err("Browser was removed from the DOM.");
|
||||
} else {
|
||||
err("Parent is: " + b.parentNode.outerHTML);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
tinfo: function(tab) {
|
||||
if (tab) {
|
||||
return tab._tPos + "(" + tab.linkedBrowser.currentURI.spec + ")";
|
||||
|
@ -6117,6 +6161,8 @@
|
|||
<binding id="tabbrowser-remote-browser"
|
||||
extends="chrome://global/content/bindings/remote-browser.xml#remote-browser">
|
||||
<implementation>
|
||||
<!-- This will go away if the binding has been removed for some reason. -->
|
||||
<field name="_alive">true</field>
|
||||
<!-- throws exception for unknown schemes -->
|
||||
<method name="loadURIWithFlags">
|
||||
<parameter name="aURI"/>
|
||||
|
|
Загрузка…
Ссылка в новой задаче