зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1674417 - [devtools] Rename SourcesManager instances. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D95333
This commit is contained in:
Родитель
a60ce46b27
Коммит
4269e69069
|
@ -970,7 +970,7 @@ class EventCollector {
|
|||
line = script.startLine;
|
||||
column = script.startColumn;
|
||||
url = script.url;
|
||||
const actor = this.targetActor.sources.getOrCreateSourceActor(
|
||||
const actor = this.targetActor.sourcesManager.getOrCreateSourceActor(
|
||||
script.source
|
||||
);
|
||||
sourceActor = actor ? actor.actorID : null;
|
||||
|
|
|
@ -65,7 +65,7 @@ const proto = {
|
|||
* the caller:
|
||||
* - createValueGrip
|
||||
* Creates a value grip for the given object
|
||||
* - sources
|
||||
* - getSourcesManager
|
||||
* SourcesManager getter that manages the sources of a thread
|
||||
* - createEnvironmentActor
|
||||
* Creates and return an environment actor
|
||||
|
@ -81,7 +81,7 @@ const proto = {
|
|||
{
|
||||
thread,
|
||||
createValueGrip: createValueGripHook,
|
||||
sources,
|
||||
getSourcesManager,
|
||||
createEnvironmentActor,
|
||||
getGripDepth,
|
||||
incrementGripDepth,
|
||||
|
@ -100,7 +100,7 @@ const proto = {
|
|||
this.thread = thread;
|
||||
this.hooks = {
|
||||
createValueGrip: createValueGripHook,
|
||||
sources,
|
||||
getSourcesManager,
|
||||
createEnvironmentActor,
|
||||
getGripDepth,
|
||||
incrementGripDepth,
|
||||
|
@ -294,7 +294,9 @@ const proto = {
|
|||
}
|
||||
|
||||
return {
|
||||
source: this.hooks.sources().createSourceActor(this.obj.script.source),
|
||||
source: this.hooks
|
||||
.getSourcesManager()
|
||||
.createSourceActor(this.obj.script.source),
|
||||
line: this.obj.script.startLine,
|
||||
column: 0, // TODO bug 901138: use Debugger.Script.prototype.startColumn
|
||||
};
|
||||
|
|
|
@ -511,10 +511,10 @@ function createObjectGrip(targetActor, depth, object, pool) {
|
|||
decrementGripDepth: () => gripDepth--,
|
||||
createValueGrip: v => createValueGripForTarget(targetActor, v, gripDepth),
|
||||
createEnvironmentActor: env => createEnvironmentActor(env, targetActor),
|
||||
sources: () =>
|
||||
getSourcesManager: () =>
|
||||
DevToolsUtils.reportException(
|
||||
"WebConsoleActor",
|
||||
Error("sources not yet implemented")
|
||||
Error("getSourcesManager not yet implemented")
|
||||
),
|
||||
},
|
||||
targetActor.conn
|
||||
|
|
|
@ -264,7 +264,7 @@ const browsingContextTargetPrototype = {
|
|||
// A map of actor names to actor instances provided by extensions.
|
||||
this._extraActors = {};
|
||||
this._exited = false;
|
||||
this._sources = null;
|
||||
this._sourcesManager = null;
|
||||
|
||||
// Map of DOM stylesheets to StyleSheetActors
|
||||
this._styleSheetActors = new Map();
|
||||
|
@ -492,11 +492,14 @@ const browsingContextTargetPrototype = {
|
|||
return null;
|
||||
},
|
||||
|
||||
get sources() {
|
||||
if (!this._sources) {
|
||||
this._sources = new SourcesManager(this.threadActor, this._allowSource);
|
||||
get sourcesManager() {
|
||||
if (!this._sourcesManager) {
|
||||
this._sourcesManager = new SourcesManager(
|
||||
this.threadActor,
|
||||
this._allowSource
|
||||
);
|
||||
}
|
||||
return this._sources;
|
||||
return this._sourcesManager;
|
||||
},
|
||||
|
||||
_createExtraActors() {
|
||||
|
@ -977,9 +980,9 @@ const browsingContextTargetPrototype = {
|
|||
this.threadActor.destroy();
|
||||
this.threadActor = null;
|
||||
|
||||
if (this._sources) {
|
||||
this._sources.destroy();
|
||||
this._sources = null;
|
||||
if (this._sourcesManager) {
|
||||
this._sourcesManager.destroy();
|
||||
this._sourcesManager = null;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -110,15 +110,15 @@ const ContentProcessTargetActor = TargetActorMixin(
|
|||
return this._consoleScope;
|
||||
},
|
||||
|
||||
get sources() {
|
||||
if (!this._sources) {
|
||||
get sourcesManager() {
|
||||
if (!this._sourcesManager) {
|
||||
assert(
|
||||
this.threadActor,
|
||||
"threadActor should exist when creating sources."
|
||||
"threadActor should exist when creating SourcesManager."
|
||||
);
|
||||
this._sources = new SourcesManager(this.threadActor);
|
||||
this._sourcesManager = new SourcesManager(this.threadActor);
|
||||
}
|
||||
return this._sources;
|
||||
return this._sourcesManager;
|
||||
},
|
||||
|
||||
/*
|
||||
|
@ -224,9 +224,9 @@ const ContentProcessTargetActor = TargetActorMixin(
|
|||
this._workerList = null;
|
||||
}
|
||||
|
||||
if (this._sources) {
|
||||
this._sources.destroy();
|
||||
this._sources = null;
|
||||
if (this._sourcesManager) {
|
||||
this._sourcesManager.destroy();
|
||||
this._sourcesManager = null;
|
||||
}
|
||||
|
||||
if (this._dbg) {
|
||||
|
|
|
@ -39,7 +39,7 @@ exports.WorkerTargetActor = TargetActorMixin(
|
|||
this.workerGlobal = workerGlobal;
|
||||
|
||||
this._workerDebuggerData = workerDebuggerData;
|
||||
this._sources = null;
|
||||
this._sourcesManager = null;
|
||||
|
||||
this.makeDebugger = makeDebuggerUtil.bind(null, {
|
||||
findDebuggees: () => {
|
||||
|
@ -83,12 +83,12 @@ exports.WorkerTargetActor = TargetActorMixin(
|
|||
return this._dbg;
|
||||
},
|
||||
|
||||
get sources() {
|
||||
if (this._sources === null) {
|
||||
this._sources = new SourcesManager(this.threadActor);
|
||||
get sourcesManager() {
|
||||
if (this._sourcesManager === null) {
|
||||
this._sourcesManager = new SourcesManager(this.threadActor);
|
||||
}
|
||||
|
||||
return this._sources;
|
||||
return this._sourcesManager;
|
||||
},
|
||||
|
||||
// This is called from the ThreadActor#onAttach method
|
||||
|
@ -100,9 +100,9 @@ exports.WorkerTargetActor = TargetActorMixin(
|
|||
destroy() {
|
||||
Actor.prototype.destroy.call(this);
|
||||
|
||||
if (this._sources) {
|
||||
this._sources.destroy();
|
||||
this._sources = null;
|
||||
if (this._sourcesManager) {
|
||||
this._sourcesManager.destroy();
|
||||
this._sourcesManager = null;
|
||||
}
|
||||
|
||||
this.workerGlobal = null;
|
||||
|
|
|
@ -273,7 +273,7 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
|
|||
},
|
||||
|
||||
get sourcesManager() {
|
||||
return this._parent.sources;
|
||||
return this._parent.sourcesManager;
|
||||
},
|
||||
|
||||
get breakpoints() {
|
||||
|
@ -1740,7 +1740,7 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
|
|||
|
||||
return createValueGrip(v, this.threadLifetimePool, this.objectGrip);
|
||||
},
|
||||
sources: () => this.sourcesManager,
|
||||
getSourcesManager: () => this.sourcesManager,
|
||||
createEnvironmentActor: (e, p) => this.createEnvironmentActor(e, p),
|
||||
promote: () => this.threadObjectGrip(actor),
|
||||
isThreadLifetimePool: () =>
|
||||
|
|
|
@ -91,7 +91,7 @@ function getSourceLineOffsets(source) {
|
|||
* The SourceActor ID
|
||||
*/
|
||||
function getActorIdForInternalSourceId(targetActor, id) {
|
||||
const actor = targetActor.sources.getSourceActorByInternalSourceId(id);
|
||||
const actor = targetActor.sourcesManager.getSourceActorByInternalSourceId(id);
|
||||
return actor ? actor.actorID : null;
|
||||
}
|
||||
exports.getActorIdForInternalSourceId = getActorIdForInternalSourceId;
|
||||
|
|
|
@ -512,10 +512,10 @@ const WebConsoleActor = ActorClassWithSpec(webconsoleSpec, {
|
|||
incrementGripDepth: () => this._gripDepth++,
|
||||
decrementGripDepth: () => this._gripDepth--,
|
||||
createValueGrip: v => this.createValueGrip(v),
|
||||
sources: () =>
|
||||
getSourcesManager: () =>
|
||||
DevToolsUtils.reportException(
|
||||
"WebConsoleActor",
|
||||
Error("sources not yet implemented")
|
||||
Error("getSourcesManager not yet implemented")
|
||||
),
|
||||
createEnvironmentActor: env => this.createEnvironmentActor(env),
|
||||
},
|
||||
|
@ -1602,7 +1602,9 @@ const WebConsoleActor = ActorClassWithSpec(webconsoleSpec, {
|
|||
},
|
||||
|
||||
getActorIdForInternalSourceId(id) {
|
||||
const actor = this.parentActor.sources.getSourceActorByInternalSourceId(id);
|
||||
const actor = this.parentActor.sourcesManager.getSourceActorByInternalSourceId(
|
||||
id
|
||||
);
|
||||
return actor ? actor.actorID : null;
|
||||
},
|
||||
|
||||
|
|
|
@ -184,11 +184,11 @@ const TestTargetActor = protocol.ActorClassWithSpec(browsingContextTargetSpec, {
|
|||
return this._global.__name;
|
||||
},
|
||||
|
||||
get sources() {
|
||||
if (!this._sources) {
|
||||
this._sources = new SourcesManager(this.threadActor);
|
||||
get sourcesManager() {
|
||||
if (!this._sourcesManager) {
|
||||
this._sourcesManager = new SourcesManager(this.threadActor);
|
||||
}
|
||||
return this._sources;
|
||||
return this._sourcesManager;
|
||||
},
|
||||
|
||||
form: function() {
|
||||
|
@ -224,7 +224,7 @@ const TestTargetActor = protocol.ActorClassWithSpec(browsingContextTargetSpec, {
|
|||
},
|
||||
|
||||
reload: function(request) {
|
||||
this.sources.reset();
|
||||
this.sourcesManager.reset();
|
||||
this.threadActor.clearDebuggees();
|
||||
this.threadActor.dbg.addDebuggees();
|
||||
return {};
|
||||
|
|
Загрузка…
Ссылка в новой задаче