зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1449931 - Remove old-event-emitter usage from devtools/shared/webconsole; r=bgrins.
MozReview-Commit-ID: HkbUm0XkeJs --HG-- extra : rebase_source : 6b75408de3370cc2f0047996532dceaab4403a34
This commit is contained in:
Родитель
ffe252e467
Коммит
41edb0dc48
|
@ -457,7 +457,7 @@ TabTarget.prototype = {
|
|||
}
|
||||
this.activeConsole = consoleClient;
|
||||
|
||||
this._onInspectObject = (event, packet) => this.emit("inspect-object", packet);
|
||||
this._onInspectObject = packet => this.emit("inspect-object", packet);
|
||||
this.activeConsole.on("inspectObject", this._onInspectObject);
|
||||
|
||||
this._remote.resolve(null);
|
||||
|
|
|
@ -178,10 +178,10 @@ class FirefoxConnector {
|
|||
displayCachedEvents() {
|
||||
for (let networkInfo of this.webConsoleClient.getNetworkEvents()) {
|
||||
// First add the request to the timeline.
|
||||
this.dataProvider.onNetworkEvent("networkEvent", networkInfo);
|
||||
this.dataProvider.onNetworkEvent(networkInfo);
|
||||
// Then replay any updates already received.
|
||||
for (let updateType of networkInfo.updates) {
|
||||
this.dataProvider.onNetworkEventUpdate("networkEventUpdate", {
|
||||
this.dataProvider.onNetworkEventUpdate({
|
||||
packet: { updateType },
|
||||
networkInfo,
|
||||
});
|
||||
|
@ -215,7 +215,7 @@ class FirefoxConnector {
|
|||
*
|
||||
* @param {object} marker
|
||||
*/
|
||||
onDocEvent(type, event) {
|
||||
onDocEvent(event) {
|
||||
this.actions.addTimingMarker(event);
|
||||
window.emit(EVENTS.TIMELINE_EVENT, event);
|
||||
}
|
||||
|
|
|
@ -288,10 +288,9 @@ class FirefoxDataProvider {
|
|||
/**
|
||||
* The "networkEvent" message type handler.
|
||||
*
|
||||
* @param {string} type message type
|
||||
* @param {object} networkInfo network request information
|
||||
*/
|
||||
async onNetworkEvent(type, networkInfo) {
|
||||
async onNetworkEvent(networkInfo) {
|
||||
let {
|
||||
actor,
|
||||
cause,
|
||||
|
@ -321,11 +320,10 @@ class FirefoxDataProvider {
|
|||
/**
|
||||
* The "networkEventUpdate" message type handler.
|
||||
*
|
||||
* @param {string} type message type
|
||||
* @param {object} packet the message received from the server.
|
||||
* @param {object} networkInfo the network request information.
|
||||
*/
|
||||
onNetworkEventUpdate(type, data) {
|
||||
onNetworkEventUpdate(data) {
|
||||
let { packet, networkInfo } = data;
|
||||
let { actor } = networkInfo;
|
||||
let { updateType } = packet;
|
||||
|
|
|
@ -216,9 +216,9 @@ function enableNetProvider(hud) {
|
|||
let updates = getAllNetworkMessagesUpdateById(newState);
|
||||
let message = updates[action.id];
|
||||
if (message && !message.openedOnce && message.source == "network") {
|
||||
dataProvider.onNetworkEvent(null, message);
|
||||
dataProvider.onNetworkEvent(message);
|
||||
message.updates.forEach(updateType => {
|
||||
dataProvider.onNetworkEventUpdate(null, {
|
||||
dataProvider.onNetworkEventUpdate({
|
||||
packet: { updateType: updateType },
|
||||
networkInfo: message,
|
||||
});
|
||||
|
@ -238,7 +238,7 @@ function enableNetProvider(hud) {
|
|||
if (open) {
|
||||
let message = getMessage(state, actor);
|
||||
message.updates.forEach(updateType => {
|
||||
dataProvider.onNetworkEventUpdate(null, {
|
||||
dataProvider.onNetworkEventUpdate({
|
||||
packet: { updateType },
|
||||
networkInfo: message,
|
||||
});
|
||||
|
|
|
@ -425,7 +425,7 @@ async function generateNetworkEventStubs() {
|
|||
for (let [key, {keys, code}] of networkEvent) {
|
||||
let onNetwork = new Promise(resolve => {
|
||||
let i = 0;
|
||||
toolbox.target.activeConsole.on("networkEvent", function onNetworkEvent(type, res) {
|
||||
toolbox.target.activeConsole.on("networkEvent", function onNetworkEvent(res) {
|
||||
stubs.packets.push(formatPacket(keys[i], res));
|
||||
stubs.preparedMessages.push(formatNetworkEventStub(keys[i], res));
|
||||
if (++i === keys.length) {
|
||||
|
|
|
@ -354,12 +354,10 @@ WebConsoleConnectionProxy.prototype = {
|
|||
* the UI for displaying.
|
||||
*
|
||||
* @private
|
||||
* @param string type
|
||||
* Message type.
|
||||
* @param object networkInfo
|
||||
* The network request information.
|
||||
*/
|
||||
_onNetworkEvent: function(type, networkInfo) {
|
||||
_onNetworkEvent: function(networkInfo) {
|
||||
if (!this.webConsoleFrame) {
|
||||
return;
|
||||
}
|
||||
|
@ -374,12 +372,10 @@ WebConsoleConnectionProxy.prototype = {
|
|||
* the UI for displaying.
|
||||
*
|
||||
* @private
|
||||
* @param string type
|
||||
* Message type.
|
||||
* @param object response
|
||||
* The update response received from the server.
|
||||
*/
|
||||
_onNetworkEventUpdate: function(type, response) {
|
||||
_onNetworkEventUpdate: function(response) {
|
||||
if (!this.webConsoleFrame) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"use strict";
|
||||
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
const EventEmitter = require("devtools/shared/old-event-emitter");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const LongStringClient = require("devtools/shared/client/long-string-client");
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче