Bug 1177279 - Create a SourceLocationController to manage the state of updating sources for source mapping. r=jlong,jryans

This commit is contained in:
Jordan Santell
2016-03-14 15:17:38 -07:00
parent 82b38fafae
commit 91eae2ce6e
14 changed files with 505 additions and 18 deletions

View File

@@ -397,6 +397,7 @@ TabTarget.prototype = {
}
this.activeTab = tabClient;
this.threadActor = response.threadActor;
attachConsole();
});
};
@@ -498,6 +499,10 @@ TabTarget.prototype = {
this.emit("frame-update", aPacket);
};
this.client.addListener("frameUpdate", this._onFrameUpdate);
this._onSourceUpdated = (event, packet) => this.emit("source-updated", packet);
this.client.addListener("newSource", this._onSourceUpdated);
this.client.addListener("updatedSource", this._onSourceUpdated);
},
/**
@@ -508,6 +513,8 @@ TabTarget.prototype = {
this.client.removeListener("tabNavigated", this._onTabNavigated);
this.client.removeListener("tabDetached", this._onTabDetached);
this.client.removeListener("frameUpdate", this._onFrameUpdate);
this.client.removeListener("newSource", this._onSourceUpdated);
this.client.removeListener("updatedSource", this._onSourceUpdated);
},
/**
@@ -603,6 +610,20 @@ TabTarget.prototype = {
let id = this._tab ? this._tab : (this._form && this._form.actor);
return `TabTarget:${id}`;
},
/**
* @see TabActor.prototype.onResolveLocation
*/
resolveLocation(loc) {
let deferred = promise.defer();
this.client.request(Object.assign({
to: this._form.actor,
type: "resolveLocation",
}, loc), deferred.resolve);
return deferred.promise;
},
};
/**