iBooks sometimes crashes when closing a book.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jul 2017 20:42:21 +0000 (20:42 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jul 2017 20:42:21 +0000 (20:42 +0000)
commit39fccdcaab68af4a7c8b428a6f32d4a174a42d11
tree1feb0c8aabe261295e72881e6794266bd2378415
parent8007f3c5bcde622ed3a63a28ea73081e75ffba6e
iBooks sometimes crashes when closing a book.
<rdar://problem/31180331> and https://bugs.webkit.org/show_bug.cgi?id=174658

Reviewed by Oliver Hunt.

Source/WebKit:

- LegacyCustomProtocolManagerProxy should not reference a WebProcessPool directly.
- LegacyCustomProtocolManagerProxy should invalidate in its destructor.

* UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp:
(WebKit::LegacyCustomProtocolManagerProxy::LegacyCustomProtocolManagerProxy):
(WebKit::LegacyCustomProtocolManagerProxy::~LegacyCustomProtocolManagerProxy):
(WebKit::LegacyCustomProtocolManagerProxy::startLoading):
(WebKit::LegacyCustomProtocolManagerProxy::stopLoading):
(WebKit::LegacyCustomProtocolManagerProxy::invalidate):
(WebKit::LegacyCustomProtocolManagerProxy::wasRedirectedToRequest):
(WebKit::LegacyCustomProtocolManagerProxy::didReceiveResponse):
(WebKit::LegacyCustomProtocolManagerProxy::didLoadData):
(WebKit::LegacyCustomProtocolManagerProxy::didFailWithError):
(WebKit::LegacyCustomProtocolManagerProxy::didFinishLoading):
(WebKit::LegacyCustomProtocolManagerProxy::processDidClose): Deleted.
* UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h:

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::NetworkProcessProxy):
(WebKit::NetworkProcessProxy::didClose):
* UIProcess/Network/NetworkProcessProxy.h:
(WebKit::NetworkProcessProxy::processPool):

Tools:

* TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm:
(-[ProcessPoolDestroyedDuringLoadingProtocol startLoading]):
(-[ProcessPoolDestroyedDuringLoadingProtocol finishTheLoad]):
(-[ProcessPoolDestroyedDuringLoadingProtocol stopLoading]):
(TestWebKitAPI::TEST):

Add a "spin the runloop X number of times" utility:
* TestWebKitAPI/Utilities.h:
* TestWebKitAPI/cocoa/UtilitiesCocoa.mm:
(TestWebKitAPI::Util::spinRunLoop):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm
Source/WebKit/UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp
Source/WebKit/UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h
Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm
Tools/TestWebKitAPI/Utilities.h
Tools/TestWebKitAPI/cocoa/UtilitiesCocoa.mm