• Matt Reynolds's avatar
    Start geolocation timer after permission prompt · f10fd2f2
    Matt Reynolds authored
    When requesting position estimates through the Geolocation API, the
    caller may specify a timeout. If the location provider cannot provide an
    estimate before the timeout expires, the returned promise is resolved
    with a TIMEOUT error.
    
    The Geolocation API specification requires that the timer is not started
    until the page has received the geolocation permission. Prior to this
    CL, Chrome would start the timer when the API call is made. This meant
    that sometimes the TIMEOUT error would be received before the user had
    made a selection in the permission prompt. This could also result in
    multiple error callbacks being called for the same geolocation request.
    
    To fix, CreateGeolocation will asynchronously return a PermissionStatus
    when the permission prompt is complete. The renderer will delay
    starting the GeoNotifier timer until a status is received that
    indicates the permission was granted.
    
    BUG=784886
    
    Change-Id: I86294ebf1d212a164e4c3a2cb96c4ad27f759cb1
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/773575Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
    Reviewed-by: default avatarConley Owens <cco3@google.com>
    Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#646465}
    f10fd2f2
geolocation-mock.js 6.08 KB