[iOS Sim Debug] ASSERTION FAILED: m_downloads.isEmpty() Layout Test http/tests/websoc...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Apr 2019 16:11:46 +0000 (16:11 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Apr 2019 16:11:46 +0000 (16:11 +0000)
commitc1293c158f37c2ddaa63eb4a93c0c8371639fc51
tree3504e5e99aa523a1cb790095a552474dc4f59c9a
parentd586232a6476ff0734112f7236edff1ee6614f61
[iOS Sim Debug] ASSERTION FAILED: m_downloads.isEmpty() Layout Test http/tests/websocket/tests/hybi/network-process-crash-error.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=196781
<rdar://problem/49789381>

Reviewed by Darin Adler.

When the network process gets terminated by the client, the NetworkProcessProxy object (and thus its DownloadProxyMap member) get
destroyed right away, before we get a call to didClose(IPC::Connection&). As a result, if there are ongoing downloads at the time
of the termination, we will hit the assertion above. To address the issue, update the NetworkProcessProxy destructor to invalidate
its DownloadProxyMap member, similator to what it does in didClose(IPC::Connection&).

* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::invalidate):
(WebKit::DownloadProxyMap::processDidClose): Deleted.
* UIProcess/Downloads/DownloadProxyMap.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::~NetworkProcessProxy):
(WebKit::NetworkProcessProxy::didClose):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Downloads/DownloadProxyMap.cpp
Source/WebKit/UIProcess/Downloads/DownloadProxyMap.h
Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp