[WK1] WebAllowDenyPolicyListener.denyOnlyThisRequest() should not start a new permiss...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jun 2015 03:54:30 +0000 (03:54 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jun 2015 03:54:30 +0000 (03:54 +0000)
commitf805047672e7fc7157d615ec8ded807446ce3248
tree85a543761ff31a3f65ae6afe090f393e18848b6c
parente3c9d74461c726202501cebf24707de92ea3ff9f
[WK1] WebAllowDenyPolicyListener.denyOnlyThisRequest() should not start a new permission request
https://bugs.webkit.org/show_bug.cgi?id=146228
<rdar://problem/15179262>

Reviewed by Daniel Bates.

Source/WebCore:

Add Geolocation::resetIsAllowed() API that merely resets
m_allowGeolocation to Unknown, so that we will request the permission
again the next time a position is requested.

* Modules/geolocation/Geolocation.h:
(WebCore::Geolocation::resetIsAllowed):

Source/WebKit/mac:

Call the new Geolocation::resetIsAllowed() API after denying the
current request, instead of calling
Geolocation::resetAllGeolocationPermission(). In addition to resetting
m_allowGeolocation to Unknown, the latter would also start a new
permission request. However, for
WebAllowDenyPolicyListener.denyOnlyThisRequest(), we really only want
to deny the current request and then reset m_allowGeolocation to
Unknown so that permission is requested again later if the app requests
a position again.

The previous implementation meant that if the client application keeps
calling WebAllowDenyPolicyListener.denyOnlyThisRequest(), we would end
up in an infinite loop (requesting for permission), even though the
application did not make any new geolocation requests.

* WebCoreSupport/WebGeolocationClient.mm:
(-[WebGeolocationPolicyListener denyOnlyThisRequest]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185860 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/geolocation/Geolocation.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebGeolocationClient.mm