mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1238873 - Handle the bug that if we take cached data, we might not get any update later. r=kchen. r=jdm.
This commit is contained in:
parent
4a0d4d375c
commit
9c64c6fe78
@ -526,6 +526,12 @@ nsGeolocationRequest::Allow(JS::HandleValue aChoices)
|
||||
// getCurrentPosition requests serviced by the cache
|
||||
// will now be owned by the RequestSendLocationEvent
|
||||
Update(lastPosition.position);
|
||||
|
||||
// After Update is called, getCurrentPosition finishes it's job.
|
||||
if (!mIsWatchPositionRequest) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} else {
|
||||
// if it is not a watch request and timeout is 0,
|
||||
// invoke the errorCallback (if present) with TIMEOUT code
|
||||
@ -534,14 +540,15 @@ nsGeolocationRequest::Allow(JS::HandleValue aChoices)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Kick off the geo device, if it isn't already running
|
||||
nsresult rv = gs->StartDevice(GetPrincipal());
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
// Location provider error
|
||||
NotifyError(nsIDOMGeoPositionError::POSITION_UNAVAILABLE);
|
||||
return NS_OK;
|
||||
}
|
||||
// Kick off the geo device, if it isn't already running
|
||||
nsresult rv = gs->StartDevice(GetPrincipal());
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
// Location provider error
|
||||
NotifyError(nsIDOMGeoPositionError::POSITION_UNAVAILABLE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (mLocator->ContainsRequest(this)) {
|
||||
|
Loading…
Reference in New Issue
Block a user