Files
palemoon27/toolkit/devtools/server/actors/child-process.js
T
roytam1 a101af758e import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 967319 - Sort object properties in natural order in the Variables View. r=jaws (e604fc318)
- Bug 1023386 - Split and filter properties remotely for objects. r=past (b4889035f)
- Bug 1149115 - Make sure source actors are created before breakpoints are reset;r=jlong (76561a3fd)
- Bug 1154606 - improve error in debugger when loading source fails r=jsantell (3678eca90)
- Bug 1159731 - Move all Addon actor subclasses to a dedicated file. r=ejpbruel (45e012a98)
- Bug 1096294 - Display pseudo-arrays like arrays in the console; r=pbrosset (b4b129b3a)
- Bug 1169064 - Part 1: Move ObjectActor to object.js r=fitzgen (579cb4f86)
- Bug 1169064 - Part 2: Formatted object.js and removed unused protocol request arguments r=fitzgen (4f3178a6a)
- Bug 792063 - Add status console shortcut to return the previous command result;r=past (fc1317f9b)
- Bug 1169064 - Part 3: Refactor LongStringActor, createValueGrip, stringIsLong and longStripGrip from script.js to object.js r=fitzgen (ecdff41b7)
- AltiVec/VMX is 32bit only, use double cast passing uintptr_t to int to fix compilation on PPC64 (93985b589)
- Bug 1084525 - Part 7: Expose Promise life time in object grip r=fitzgen (db5000041)
- Bug 1084525 - Part 8: Expose Promise time to settle in object grip r=fitzgen (65b7beb26)
- Bug 1084525 - Part 9: Implement getDependentPromises method in ObjectClient r=fitzgen (8cc8be31d)
- Bug 1148753 - Update browser content toolbox to create a TabSources instance. r=jryans (df6bf505f)
- Bug 1050691 - Click on a function on the console should go to the debugger. r=jlongster (e0d225db1)
- Bug 1084525 - Part 10: Implement getAllocationStack method in ObjectClient r=fitzgen (199ce4dd9)
- Bug 1084525 - Part 12: Fix eslint complaints in promise.js r=fitzgen (7d0a38afe)
- Bug 1084525 - Part 13: Add test for asserting the Promise allocation stack in chrome debugging r=fitzgen (60278cf1d)
- Bug 1164564 - Refactor Promise-backend.js so it can be required as a CommonJS module on the main thread;r=paolo (7cfe3cdd9)
- Bug 1181506 - Define Cc and Ci. r=Yoric (bc3968be3)
2021-04-20 09:17:23 +08:00

107 lines
2.8 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { Cc, Ci, Cu } = require("chrome");
const { ChromeDebuggerActor } = require("devtools/server/actors/script");
const { WebConsoleActor } = require("devtools/server/actors/webconsole");
const makeDebugger = require("devtools/server/actors/utils/make-debugger");
const { ActorPool } = require("devtools/server/main");
const Services = require("Services");
const { dbg_assert } = require("devtools/toolkit/DevToolsUtils");
const { TabSources } = require("./utils/TabSources");
function ChildProcessActor(aConnection) {
this.conn = aConnection;
this._contextPool = new ActorPool(this.conn);
this.conn.addActorPool(this._contextPool);
this.threadActor = null;
// Use a see-everything debugger
this.makeDebugger = makeDebugger.bind(null, {
findDebuggees: dbg => dbg.findAllGlobals(),
shouldAddNewGlobalAsDebuggee: global => true
});
// Scope into which the webconsole executes:
// An empty sandbox with chrome privileges
let systemPrincipal = Cc["@mozilla.org/systemprincipal;1"]
.createInstance(Ci.nsIPrincipal);
let sandbox = Cu.Sandbox(systemPrincipal);
this._consoleScope = sandbox;
}
exports.ChildProcessActor = ChildProcessActor;
ChildProcessActor.prototype = {
actorPrefix: "process",
get isRootActor() {
return true;
},
get exited() {
return !this._contextPool;
},
get url() {
return undefined;
},
get window() {
return this._consoleScope;
},
get sources() {
if (!this._sources) {
dbg_assert(this.threadActor, "threadActor should exist when creating sources.");
this._sources = new TabSources(this.threadActor);
}
return this._sources;
},
form: function() {
if (!this._consoleActor) {
this._consoleActor = new WebConsoleActor(this.conn, this);
this._contextPool.addActor(this._consoleActor);
}
if (!this.threadActor) {
this.threadActor = new ChromeDebuggerActor(this.conn, this);
this._contextPool.addActor(this.threadActor);
}
return {
actor: this.actorID,
name: "Content process",
consoleActor: this._consoleActor.actorID,
chromeDebugger: this.threadActor.actorID,
traits: {
highlightable: false,
networkMonitor: false,
},
};
},
disconnect: function() {
this.conn.removeActorPool(this._contextPool);
this._contextPool = null;
},
preNest: function() {
// TODO: freeze windows
// window mediator doesn't work in child.
// it doesn't throw, but doesn't return any window
},
postNest: function() {
},
};
ChildProcessActor.prototype.requestTypes = {
};