browser(firefox): fix firefox crashes (#9563)

Fixes #9418
This commit is contained in:
Andrey Lushnikov 2021-10-15 19:37:00 -07:00 committed by GitHub
parent 0160c18f7a
commit 18e690e234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 4 deletions

View File

@ -1,2 +1,2 @@
1296
Changed: lushnikov@chromium.org Thu 14 Oct 2021 12:01:09 PM PDT
1297
Changed: lushnikov@chromium.org Fri Oct 15 18:52:51 PDT 2021

View File

@ -540,6 +540,11 @@ class NetworkRequest {
// nsIStreamListener
onDataAvailable(aRequest, aInputStream, aOffset, aCount) {
// Turns out webcompat shims might redirect to
// SimpleChannel, so we get requests from a different channel.
// See https://github.com/microsoft/playwright/issues/9418#issuecomment-944836244
if (aRequest !== this.httpChannel)
return;
// For requests with internal redirect (e.g. intercepted by Service Worker),
// we do not get onResponse normally, but we do get nsIStreamListener notifications.
this._sendOnResponse(false);
@ -562,6 +567,11 @@ class NetworkRequest {
// nsIStreamListener
onStartRequest(aRequest) {
// Turns out webcompat shims might redirect to
// SimpleChannel, so we get requests from a different channel.
// See https://github.com/microsoft/playwright/issues/9418#issuecomment-944836244
if (aRequest !== this.httpChannel)
return;
try {
this._originalListener.onStartRequest(aRequest);
} catch (e) {
@ -571,6 +581,11 @@ class NetworkRequest {
// nsIStreamListener
onStopRequest(aRequest, aStatusCode) {
// Turns out webcompat shims might redirect to
// SimpleChannel, so we get requests from a different channel.
// See https://github.com/microsoft/playwright/issues/9418#issuecomment-944836244
if (aRequest !== this.httpChannel)
return;
try {
this._originalListener.onStopRequest(aRequest, aStatusCode);
} catch (e) {

View File

@ -1,2 +1,2 @@
1296
Changed: lushnikov@chromium.org Wed Oct 13 15:47:14 PDT 2021
1297
Changed: lushnikov@chromium.org Fri Oct 15 18:51:16 PDT 2021

View File

@ -540,6 +540,11 @@ class NetworkRequest {
// nsIStreamListener
onDataAvailable(aRequest, aInputStream, aOffset, aCount) {
// Turns out webcompat shims might redirect to
// SimpleChannel, so we get requests from a different channel.
// See https://github.com/microsoft/playwright/issues/9418#issuecomment-944836244
if (aRequest !== this.httpChannel)
return;
// For requests with internal redirect (e.g. intercepted by Service Worker),
// we do not get onResponse normally, but we do get nsIStreamListener notifications.
this._sendOnResponse(false);
@ -562,6 +567,11 @@ class NetworkRequest {
// nsIStreamListener
onStartRequest(aRequest) {
// Turns out webcompat shims might redirect to
// SimpleChannel, so we get requests from a different channel.
// See https://github.com/microsoft/playwright/issues/9418#issuecomment-944836244
if (aRequest !== this.httpChannel)
return;
try {
this._originalListener.onStartRequest(aRequest);
} catch (e) {
@ -571,6 +581,11 @@ class NetworkRequest {
// nsIStreamListener
onStopRequest(aRequest, aStatusCode) {
// Turns out webcompat shims might redirect to
// SimpleChannel, so we get requests from a different channel.
// See https://github.com/microsoft/playwright/issues/9418#issuecomment-944836244
if (aRequest !== this.httpChannel)
return;
try {
this._originalListener.onStopRequest(aRequest, aStatusCode);
} catch (e) {