mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Backed out changeset e4208dfc006f (bug 1636420) for test_protocol_index.js failures CLOSED TREE
This commit is contained in:
parent
03436162ac
commit
d7a0ca85b2
@ -2142,9 +2142,6 @@ pref("devtools.netmonitor.har.enableAutoExportToFile", false);
|
||||
|
||||
pref("devtools.netmonitor.features.webSockets", true);
|
||||
|
||||
// Disable the EventSource Inspector.
|
||||
pref("devtools.netmonitor.features.serverSentEvents", false);
|
||||
|
||||
// Enable the Storage Inspector
|
||||
pref("devtools.storage.enabled", true);
|
||||
|
||||
|
@ -1,93 +0,0 @@
|
||||
/* 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 {
|
||||
FrontClassWithSpec,
|
||||
registerFront,
|
||||
} = require("devtools/shared/protocol");
|
||||
const { eventSourceSpec } = require("devtools/shared/specs/eventsource");
|
||||
|
||||
/**
|
||||
* A EventSourceFront is used as a front end for the EventSourceActor that is
|
||||
* created on the server, hiding implementation details.
|
||||
*/
|
||||
class EventSourceFront extends FrontClassWithSpec(eventSourceSpec) {
|
||||
constructor(client, targetFront, parentFront) {
|
||||
super(client, targetFront, parentFront);
|
||||
|
||||
this._onEventSourceConnectionOpened = this._onEventSourceConnectionOpened.bind(
|
||||
this
|
||||
);
|
||||
this._onEventSourceConnectionClosed = this._onEventSourceConnectionClosed.bind(
|
||||
this
|
||||
);
|
||||
this._onEventReceived = this._onEventReceived.bind(this);
|
||||
|
||||
// Attribute name from which to retrieve the actorID
|
||||
// out of the target actor's form
|
||||
this.formAttributeName = "eventSourceActor";
|
||||
|
||||
this.on(
|
||||
"serverEventSourceConnectionOpened",
|
||||
this._onEventSourceConnectionOpened
|
||||
);
|
||||
this.on(
|
||||
"serverEventSourceConnectionClosed",
|
||||
this._onEventSourceConnectionClosed
|
||||
);
|
||||
this.on("serverEventReceived", this._onEventReceived);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the EventSourceFront.
|
||||
*/
|
||||
destroy() {
|
||||
this.off("serverEventSourceConnectionOpened");
|
||||
this.off("serverEventSourceConnectionClosed");
|
||||
this.off("serverEventReceived");
|
||||
return super.destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* The "eventSourceConnectionOpened" message type handler. We redirect any
|
||||
* message to the UI for displaying.
|
||||
*
|
||||
* @private
|
||||
* @param number httpChannelId
|
||||
* Channel ID of the eventsource connection.
|
||||
*/
|
||||
async _onEventSourceConnectionOpened(httpChannelId) {
|
||||
this.emit("eventSourceConnectionOpened", httpChannelId);
|
||||
}
|
||||
|
||||
/**
|
||||
* The "eventSourceConnectionClosed" message type handler. We redirect any message to
|
||||
* the UI for displaying.
|
||||
*
|
||||
* @private
|
||||
* @param number httpChannelId
|
||||
*/
|
||||
async _onEventSourceConnectionClosed(httpChannelId) {
|
||||
this.emit("eventSourceConnectionClosed", httpChannelId);
|
||||
}
|
||||
|
||||
/**
|
||||
* The "eventReceived" message type handler. We redirect any message to
|
||||
* the UI for displaying.
|
||||
*
|
||||
* @private
|
||||
* @param string httpChannelId
|
||||
* Channel ID of the eventSource connection.
|
||||
* @param object data
|
||||
* The data received from the server.
|
||||
*/
|
||||
async _onEventReceived(httpChannelId, data) {
|
||||
this.emit("eventReceived", httpChannelId, data);
|
||||
}
|
||||
}
|
||||
|
||||
exports.EventSourceFront = EventSourceFront;
|
||||
registerFront(EventSourceFront);
|
@ -21,7 +21,6 @@ DevToolsModules(
|
||||
'css-properties.js',
|
||||
'device.js',
|
||||
'environment.js',
|
||||
'eventsource.js',
|
||||
'frame.js',
|
||||
'framerate.js',
|
||||
'highlighters.js',
|
||||
|
@ -187,26 +187,6 @@ class FirefoxConnector {
|
||||
// Support for FF68 or older
|
||||
}
|
||||
}
|
||||
|
||||
// Support for EventSource monitoring is currently hidden behind this pref.
|
||||
if (
|
||||
Services.prefs.getBoolPref(
|
||||
"devtools.netmonitor.features.serverSentEvents"
|
||||
)
|
||||
) {
|
||||
const eventSourceFront = await this.currentTarget.getFront("eventSource");
|
||||
eventSourceFront.startListening();
|
||||
|
||||
eventSourceFront.on(
|
||||
"eventSourceConnectionOpened",
|
||||
this.dataProvider.onEventSourceConnectionOpened
|
||||
);
|
||||
eventSourceFront.on(
|
||||
"eventSourceConnectionClosed",
|
||||
this.dataProvider.onEventSourceConnectionClosed
|
||||
);
|
||||
eventSourceFront.on("eventReceived", this.dataProvider.onEventReceived);
|
||||
}
|
||||
}
|
||||
|
||||
removeListeners() {
|
||||
@ -234,19 +214,6 @@ class FirefoxConnector {
|
||||
this.dataProvider.onNetworkEventUpdate
|
||||
);
|
||||
}
|
||||
|
||||
const eventSourceFront = this.currentTarget.getCachedFront("eventSource");
|
||||
if (eventSourceFront) {
|
||||
eventSourceFront.off(
|
||||
"eventSourceConnectionOpened",
|
||||
this.dataProvider.onEventSourceConnectionOpened
|
||||
);
|
||||
eventSourceFront.off(
|
||||
"eventSourceConnectionClosed",
|
||||
this.dataProvider.onEventSourceConnectionClosed
|
||||
);
|
||||
eventSourceFront.off("eventReceived", this.dataProvider.onEventReceived);
|
||||
}
|
||||
}
|
||||
|
||||
enableActions(enable) {
|
||||
|
@ -55,14 +55,6 @@ class FirefoxDataProvider {
|
||||
this.onWebSocketClosed = this.onWebSocketClosed.bind(this);
|
||||
this.onFrameSent = this.onFrameSent.bind(this);
|
||||
this.onFrameReceived = this.onFrameReceived.bind(this);
|
||||
|
||||
this.onEventSourceConnectionOpened = this.onEventSourceConnectionOpened.bind(
|
||||
this
|
||||
);
|
||||
this.onEventSourceConnectionClosed = this.onEventSourceConnectionClosed.bind(
|
||||
this
|
||||
);
|
||||
this.onEventReceived = this.onEventReceived.bind(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -796,30 +788,6 @@ class FirefoxDataProvider {
|
||||
return payload.stacktrace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle EventSource events.
|
||||
*/
|
||||
async onEventSourceConnectionOpened(httpChannelId) {
|
||||
// By default, an EventSource connection doesn't immediately get its mimeType, or
|
||||
// any info which could help us identify a connection is an SSE channel.
|
||||
// We can update the request's mimeType through this event.
|
||||
if (this.actionsEnabled && this.actions.updateMimeType) {
|
||||
// TODO: Implement action updateMimeType.
|
||||
await this.actions.updateMimeType(
|
||||
httpChannelId,
|
||||
"text/event-stream",
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async onEventSourceConnectionClosed(httpChannelId) {}
|
||||
|
||||
async onEventReceived(httpChannelId, data) {
|
||||
// Dispatch the same action used by websocket inspector.
|
||||
this.addFrame(httpChannelId, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fire events for the owner object.
|
||||
*/
|
||||
|
@ -302,11 +302,6 @@ const Types = (exports.__TypesForTests = [
|
||||
spec: "devtools/shared/specs/websocket",
|
||||
front: "devtools/client/fronts/websocket",
|
||||
},
|
||||
{
|
||||
types: ["eventSource"],
|
||||
spec: "devtools/shared/specs/eventsource",
|
||||
front: "devtools/client/fronts/eventsource",
|
||||
},
|
||||
{
|
||||
types: ["pushSubscription"],
|
||||
spec: "devtools/shared/specs/worker/push-subscription",
|
||||
|
Loading…
Reference in New Issue
Block a user