Bug 1634982 - Don't call DocumentChannelBridgeDisconnected when already being disconnected from the DocumentLoadListener. r=mattwoodrow

Differential Revision: https://phabricator.services.mozilla.com/D74517
This commit is contained in:
Jean-Yves Avenard 2020-05-11 00:42:09 +00:00
Родитель 3ccaaa0422
Коммит 28d4ac9c33
2 изменённых файлов: 9 добавлений и 3 удалений

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

@ -162,12 +162,16 @@ void ParentProcessDocumentChannel::DisconnectDocumentLoadListener() {
if (!mDocumentLoadListener) {
return;
}
mDocumentLoadListener->DocumentChannelBridgeDisconnected();
mDocumentLoadListener = nullptr;
RemoveObserver();
}
void ParentProcessDocumentChannel::RemoveObserver() {
if (nsCOMPtr<nsIObserverService> observerService =
mozilla::services::GetObserverService()) {
observerService->RemoveObserver(this, NS_HTTP_ON_MODIFY_REQUEST_TOPIC);
}
mDocumentLoadListener->DocumentChannelBridgeDisconnected();
mDocumentLoadListener = nullptr;
}
////////////////////////////////////////////////////////////////////////////////

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

@ -42,7 +42,8 @@ class ParentProcessDocumentChannel : public DocumentChannel,
void DisconnectChildListeners(nsresult aStatus,
nsresult aLoadGroupStatus) override {
DocumentChannel::DisconnectChildListeners(aStatus, aLoadGroupStatus);
DisconnectDocumentLoadListener();
RemoveObserver();
mDocumentLoadListener = nullptr;
}
void Delete() override {}
void DeleteIPDL() override {
@ -53,6 +54,7 @@ class ParentProcessDocumentChannel : public DocumentChannel,
private:
virtual ~ParentProcessDocumentChannel();
void DisconnectDocumentLoadListener();
void RemoveObserver();
RefPtr<DocumentLoadListener> mDocumentLoadListener;
nsTArray<ipc::Endpoint<extensions::PStreamFilterParent>>