Bug 1669681 - [devtools] Send tabDetached event before the forwardingCancelled event in content-process-connector r=ochameau

Depends on D93029

Emitting "forwardingCancelled" will result in purging requests on the target front, which almost equates to destroying the front.
We should emit the "tabDetached" event before that to avoid emitting events on already destroyed fronts.

Differential Revision: https://phabricator.services.mozilla.com/D93030
This commit is contained in:
Julian Descottes 2020-10-12 08:13:19 +00:00
Родитель a9480f8030
Коммит e1074b5ab6
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -287,6 +287,12 @@ class Front extends Pool {
* Handler for incoming packets from the client's actor.
*/
onPacket(packet) {
if (this.isDestroyed()) {
// If the Front was already destroyed, all the requests have been purged
// and rejected with detailed error messages in purgeRequestsForDestroy.
return;
}
// Pick off event packets
const type = packet.type || undefined;
if (this._clientSpec.events && this._clientSpec.events.has(type)) {