Backed out 5 changesets (bug 1701790) for bc failures in browser_ext_devtools_network_targetSwitch.js. CLOSED TREE

Backed out changeset 3fc4edd663d9 (bug 1701790)
Backed out changeset 2d3ea7c0d695 (bug 1701790)
Backed out changeset 6cb7502fc1a2 (bug 1701790)
Backed out changeset 8f4205a1a369 (bug 1701790)
Backed out changeset bd3c9b1482c7 (bug 1701790)
This commit is contained in:
Brindusan Cristian
2021-05-03 22:21:59 +03:00
parent 2d8d9acc5f
commit d5be5fbb54
143 changed files with 930 additions and 767 deletions

View File

@@ -75,8 +75,8 @@ class ChangesView {
return this._contextMenu;
}
get resourceCommand() {
return this.inspector.toolbox.resourceCommand;
get resourceWatcher() {
return this.inspector.toolbox.resourceWatcher;
}
init() {
@@ -101,27 +101,27 @@ class ChangesView {
}
async watchResources() {
await this.resourceCommand.watchResources(
[this.resourceCommand.TYPES.DOCUMENT_EVENT],
await this.resourceWatcher.watchResources(
[this.resourceWatcher.TYPES.DOCUMENT_EVENT],
{
onAvailable: this.onResourceAvailable,
// Ignore any DOCUMENT_EVENT resources that have occured in the past
// and are cached by the resource command, otherwise the Changes panel will
// and are cached by the resource watcher, otherwise the Changes panel will
// react to them erroneously and interpret that the document is reloading *now*
// which leads to clearing all stored changes.
ignoreExistingResources: true,
}
);
await this.resourceCommand.watchResources(
[this.resourceCommand.TYPES.CSS_CHANGE],
await this.resourceWatcher.watchResources(
[this.resourceWatcher.TYPES.CSS_CHANGE],
{ onAvailable: this.onResourceAvailable }
);
}
onResourceAvailable(resources) {
for (const resource of resources) {
if (resource.resourceType === this.resourceCommand.TYPES.CSS_CHANGE) {
if (resource.resourceType === this.resourceWatcher.TYPES.CSS_CHANGE) {
this.onAddChange(resource);
continue;
}
@@ -256,10 +256,10 @@ class ChangesView {
* Destruction function called when the inspector is destroyed.
*/
destroy() {
this.resourceCommand.unwatchResources(
this.resourceWatcher.unwatchResources(
[
this.resourceCommand.TYPES.CSS_CHANGE,
this.resourceCommand.TYPES.DOCUMENT_EVENT,
this.resourceWatcher.TYPES.CSS_CHANGE,
this.resourceWatcher.TYPES.DOCUMENT_EVENT,
],
{ onAvailable: this.onResourceAvailable }
);