StorageArea should not be destructed on the main thread
authorsihui_liu@apple.com <sihui_liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jul 2019 22:26:25 +0000 (22:26 +0000)
committersihui_liu@apple.com <sihui_liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jul 2019 22:26:25 +0000 (22:26 +0000)
commit9735014e6a06c23f355c77e8c811478ab7d3a755
tree13d040ac8712298ca83a536c66ab9ddacdd4b0a3
parentcc02d60b2dbdcf24f6f0e27b92fc4485aea394cb
StorageArea should not be destructed on the main thread
https://bugs.webkit.org/show_bug.cgi?id=199713
<rdar://problem/52911900>

Reviewed by Alex Christensen.

After r246079, LocalStorageNameSpace could be destructed on the main thread and it may hold the last reference
to StorageArea. Then we saw the crashes that StorageArea was wrongly destructed on the main thread.

* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::~NetworkSession):
* NetworkProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::waitUntilTasksFinished):
(WebKit::StorageManager::waitUntilWritesFinished): Deleted.
* NetworkProcess/WebStorage/StorageManager.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247370 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkSession.cpp
Source/WebKit/NetworkProcess/WebStorage/StorageManager.cpp
Source/WebKit/NetworkProcess/WebStorage/StorageManager.h