Bug 1264873 - Ensure exposing memory actor for the browser content toolbox. r=yulia

MozReview-Commit-ID: 3duHXef13M4

--HG--
extra : rebase_source : 8f372fedbbfe59ec7c2756bde61450e67f46345a
This commit is contained in:
Alexandre Poirot 2018-07-18 09:00:44 -07:00
Родитель 85865937f5
Коммит 6a298fd038
2 изменённых файлов: 14 добавлений и 3 удалений

Просмотреть файл

@ -22,6 +22,7 @@ const { assert } = require("devtools/shared/DevToolsUtils");
const { TabSources } = require("devtools/server/actors/utils/TabSources");
loader.lazyRequireGetter(this, "WorkerTargetActorList", "devtools/server/actors/worker/worker-list", true);
loader.lazyRequireGetter(this, "MemoryActor", "devtools/server/actors/memory", true);
function ContentProcessTargetActor(connection) {
this.conn = connection;
@ -104,13 +105,17 @@ ContentProcessTargetActor.prototype = {
this.threadActor = new ChromeDebuggerActor(this.conn, this);
this._contextPool.addActor(this.threadActor);
}
if (!this.memoryActor) {
this.memoryActor = new MemoryActor(this.conn, this);
this._contextPool.addActor(this.memoryActor);
}
return {
actor: this.actorID,
name: "Content process",
consoleActor: this._consoleActor.actorID,
chromeDebugger: this.threadActor.actorID,
memoryActor: this.memoryActor.actorID,
traits: {
highlightable: false,

Просмотреть файл

@ -418,8 +418,14 @@ Memory.prototype = {
* Accesses the docshell to return the current process time.
*/
_getCurrentTime: function() {
return (this.parent.isRootActor ? this.parent.docShell :
this.parent.originalDocShell).now();
const docShell = this.parent.isRootActor ? this.parent.docShell :
this.parent.originalDocShell;
if (docShell) {
return docShell.now();
}
// When used from the ContentProcessTargetActor, parent has no docShell,
// so fallback to Cu.now
return Cu.now();
},
};