зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1697747 - [devtools] Ignore already destroyed root node resources in onResourceAvailable callback. r=jdescottes.
It looks like this reduces the number of failures in browser_toolbox_backward_forward_navigation.js. Differential Revision: https://phabricator.services.mozilla.com/D107980
This commit is contained in:
Родитель
55e5804632
Коммит
8469f542e0
|
@ -1302,7 +1302,11 @@ Inspector.prototype = {
|
|||
onResourceAvailable: function(resources) {
|
||||
for (const resource of resources) {
|
||||
if (
|
||||
resource.resourceType === this.toolbox.resourceWatcher.TYPES.ROOT_NODE
|
||||
resource.resourceType ===
|
||||
this.toolbox.resourceWatcher.TYPES.ROOT_NODE &&
|
||||
// It might happen that the ROOT_NODE resource (which is a Front) is already
|
||||
// destroyed, and in such case we want to ignore it.
|
||||
!resource.isDestroyed()
|
||||
) {
|
||||
const rootNodeFront = resource;
|
||||
const isTopLevelTarget = !!resource.targetFront.isTopLevel;
|
||||
|
|
|
@ -1442,8 +1442,11 @@ MarkupView.prototype = {
|
|||
|
||||
_onResourceAvailable: async function(resources) {
|
||||
for (const resource of resources) {
|
||||
if (resource.resourceType !== this.resourceWatcher.TYPES.ROOT_NODE) {
|
||||
// Only handle root-node resources
|
||||
if (
|
||||
resource.resourceType !== this.resourceWatcher.TYPES.ROOT_NODE ||
|
||||
resource.isDestroyed()
|
||||
) {
|
||||
// Only handle alive root-node resources
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -1741,7 +1741,12 @@ class HighlightersOverlay {
|
|||
*/
|
||||
async _onResourceAvailable(resources) {
|
||||
for (const resource of resources) {
|
||||
if (resource.resourceType !== this.resourceWatcher.TYPES.ROOT_NODE) {
|
||||
if (
|
||||
resource.resourceType !== this.resourceWatcher.TYPES.ROOT_NODE ||
|
||||
// It might happen that the ROOT_NODE resource (which is a Front) is already
|
||||
// destroyed, and in such case we want to ignore it.
|
||||
resource.isDestroyed()
|
||||
) {
|
||||
// Only handle root-node resources.
|
||||
// Note that we could replace this with DOCUMENT_EVENT resources, since
|
||||
// the actual root-node resource is not used here.
|
||||
|
|
Загрузка…
Ссылка в новой задаче