Fix crash in ~WebProcessPool when using Geolocation with useNetworkProcess=true
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Nov 2015 18:39:16 +0000 (18:39 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Nov 2015 18:39:16 +0000 (18:39 +0000)
commit35a6da1db8077b7e3328978fada0e213aabdfb74
treea9ae3108eb75c2f144f263a0da93666d4017fd39
parent8de4eaa9eb48ff931460dd0d7e1cc240cc0df67b
Fix crash in ~WebProcessPool when using Geolocation with useNetworkProcess=true
https://bugs.webkit.org/show_bug.cgi?id=151532

Reviewed by Benjamin Poulain.

Source/WebKit2:

* UIProcess/WebGeolocationManagerProxy.cpp:
(WebKit::WebGeolocationManagerProxy::processPoolDestroyed):
(WebKit::WebGeolocationManagerProxy::processDidClose):
When a WebProcessPool is destroyed, only call stopUpdating if m_updateRequesters.clear()
stopped the updating, like we do in WebGeolocationManagerProxy::removeRequester.
Otherwise, call setEnableHighAccuracy if needed, also like we do in WebGeolocationManagerProxy::removeRequester.

Tools:

* TestWebKitAPI/Tests/WebKit2/Geolocation.cpp:
(TestWebKitAPI::GeolocationTransitionToHighAccuracyStateTracker::eventsChanged):
(TestWebKitAPI::TEST):
(TestWebKitAPI::GeolocationTransitionToLowAccuracyStateTracker::eventsChanged):
(TestWebKitAPI::GeolocationTransitionToHighAccuracyStateTracker::GeolocationTransitionToHighAccuracyStateTracker): Deleted.
(TestWebKitAPI::GeolocationTransitionToLowAccuracyStateTracker::GeolocationTransitionToLowAccuracyStateTracker): Deleted.
Properly load about:blank in all WebViews to clean up.  Without this change, we had a
Geolocation provider stopping after its state tracker was destroyed with its stack frame,
so it was calling a function on a test object that had gone out of scope.
Also, call WKContextSetUsesNetworkProcess(context, true) to show what crash this fixed,
but that will become the default soon and that call will be removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2/Geolocation.cpp