In Geolocation::requestPermission, m_allowGeolocation is overriden to InProgress after page->chrome()->requestGeolocationPermissionForFrame(m_frame, this) is called. In case requestGeolocationPermissionForFrame is implemented with a modal dialog and calls Geolocation::setIsAllowed(true) directly, m_allowGeolocation never becomes Yes.
Created attachment 33509 [details] Geolocation patch Don't override m_allowGeolocation.
Whoever wrote the geolocation stuff should review this. I assume this client call is expected to be async not synchronous?
> I assume this client call is expected to be async not synchronous? That's correct. I'm not sure if there's any need to support synchronous client calls. > Whoever wrote the geolocation stuff should review this. This was written by Greg. However, I'm pretty sure that this patch doesn't fix the problem correctly. If the supplied patch is used, and requestGeolocationPermissionsForFrame is implemented synchronously, watches will be called back twice, rather than once. geolocationServicePositionChanged() assumes that if requestPermission() calls requestGeolocationPermissionsForFrame(), isAllowed() will return false immediately after requestPermission() returns. If requestGeolocationPermissionsForFrame() is implemented synchronously. this is not true. So from geolocationServicePositionChanged(), requestPermission() will call requestGeolocationPermissionsForFrame(), which will synchronously call setIsAllowed(), call back into geolocationServicePositionChanged() and call back the one-shots and watchers. When requestPermission returns, isAllowed() will return true and the watchers will be called back a second time.
Comment on attachment 33509 [details] Geolocation patch r- per above comments.
This is identical to Yong's patch from our git repo which was checked in a while ago. *** This bug has been marked as a duplicate of bug 26993 ***