Crash in both StorageProcess and UIProcess when using custom WKWebsiteDataStores...
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jun 2018 19:28:18 +0000 (19:28 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jun 2018 19:28:18 +0000 (19:28 +0000)
commit258398b68671aa131c49487873358a68712609f7
treebb393f06935b482a6da6c4c286aca7c6c685764b
parent63955266b84277059264a970c8e369ebe4353ccb
Crash in both StorageProcess and UIProcess when using custom WKWebsiteDataStores for data management.
<rdar://problem/41019893> and https://bugs.webkit.org/show_bug.cgi?id=186682

Reviewed by Chris Dumez.

Source/WebKit:

* UIProcess/Storage/StorageProcessProxy.cpp:
(WebKit::StorageProcessProxy::didClose): Protect this and the process pool as the cleanup that follows
  might cause either to get destroyed.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataAndApply): Protect the operating WebsiteDataStore while async operations
  are in flight. Otherwise if the data store is destroyed, the SessionIDs for those operations will get
  destroyed before they complete.
(WebKit::WebsiteDataStore::removeData): Ditto.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Storage/StorageProcessProxy.cpp
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKitCocoa/SimpleServiceWorkerRegistrations-2.sqlite3 [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKitCocoa/SimpleServiceWorkerRegistrations-2.sqlite3-shm [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKitCocoa/SimpleServiceWorkerRegistrations-2.sqlite3-wal [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm