Skip to content

Commit

Permalink
Backed out 4 changesets (bug 1543098) for high frequency browser_runt…
Browse files Browse the repository at this point in the history
…ime_executionContext.js failures CLOSED TREE

Backed out changeset a414e99fbbc8 (bug 1543098)
Backed out changeset f5645934c8ec (bug 1543098)
Backed out changeset 142fc2db9173 (bug 1543098)
Backed out changeset 0a13ac4fa9d7 (bug 1543098)
  • Loading branch information
SV-ACiure committed May 1, 2019
1 parent 9b79007 commit b63cc4d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 190 deletions.
85 changes: 0 additions & 85 deletions remote/domains/content/Runtime.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
var EXPORTED_SYMBOLS = ["Runtime"];

const {ContentProcessDomain} = ChromeUtils.import("chrome://remote/content/domains/ContentProcessDomain.jsm");
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

class Runtime extends ContentProcessDomain {
constructor(session) {
Expand All @@ -24,96 +23,12 @@ class Runtime extends ContentProcessDomain {
async enable() {
if (!this.enabled) {
this.enabled = true;
this.chromeEventHandler.addEventListener("DOMWindowCreated", this,
{mozSystemGroup: true});

// Listen for pageshow and pagehide to track pages going in/out to/from the BF Cache
this.chromeEventHandler.addEventListener("pageshow", this,
{mozSystemGroup: true});
this.chromeEventHandler.addEventListener("pagehide", this,
{mozSystemGroup: true});

Services.obs.addObserver(this, "inner-window-destroyed");

// Spin the event loop in order to send the `executionContextCreated` event right
// after we replied to `enable` request.
Services.tm.dispatchToMainThread(() => {
const frameId = this.content.windowUtils.outerWindowID;
const id = this.content.windowUtils.currentInnerWindowID;
this.emit("Runtime.executionContextCreated", {
context: {
id,
auxData: {
isDefault: true,
frameId,
},
},
});
});
}
}

disable() {
if (this.enabled) {
this.enabled = false;
this.chromeEventHandler.removeEventListener("DOMWindowCreated", this,
{mozSystemGroup: true});
this.chromeEventHandler.removeEventListener("pageshow", this,
{mozSystemGroup: true});
this.chromeEventHandler.removeEventListener("pagehide", this,
{mozSystemGroup: true});
Services.obs.removeObserver(this, "inner-window-destroyed");
}
}

handleEvent({type, target, persisted}) {
const frameId = target.defaultView.windowUtils.outerWindowID;
const id = target.defaultView.windowUtils.currentInnerWindowID;
switch (type) {
case "DOMWindowCreated":
this.emit("Runtime.executionContextCreated", {
context: {
id,
auxData: {
isDefault: target == this.content.document,
frameId,
},
},
});
break;

case "pageshow":
// `persisted` is true when this is about a page being resurected from BF Cache
if (!persisted) {
return;
}
this.emit("Runtime.executionContextCreated", {
context: {
id,
auxData: {
isDefault: target == this.content.document,
frameId,
},
},
});
break;

case "pagehide":
// `persisted` is true when this is about a page being frozen into BF Cache
if (!persisted) {
return;
}
this.emit("Runtime.executionContextDestroyed", {
executionContextId: id,
});
break;
}
}

observe(subject, topic, data) {
const innerWindowID = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
this.emit("Runtime.executionContextDestroyed", {
executionContextId: innerWindowID,
});
}
}
1 change: 0 additions & 1 deletion remote/test/browser/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ skip-if = debug || asan # bug 1546945
[browser_cdp.js]
[browser_main_target.js]
[browser_page_frameNavigated.js]
[browser_runtime_executionContext.js]
[browser_tabs.js]
[browser_target.js]
104 changes: 0 additions & 104 deletions remote/test/browser/browser_runtime_executionContext.js

This file was deleted.

0 comments on commit b63cc4d

Please sign in to comment.