Bug 681941 - Ensure that we always clear geolocation requests that are not long-lived, and never clear ones that are. r=dougt

This commit is contained in:
Josh Matthews 2011-08-25 15:13:25 -04:00
Родитель 1fa104a507
Коммит 134e9f8707
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -149,7 +149,7 @@ public:
// have to do more, then we can change this around.
RequestSendLocationEvent(nsIDOMGeoPosition* aPosition,
nsGeolocationRequest* aRequest,
nsGeolocation* aLocator = nsnull)
nsGeolocation* aLocator)
: mPosition(aPosition),
mRequest(aRequest),
mLocator(aLocator)
@ -389,7 +389,9 @@ nsGeolocationRequest::Allow()
// okay, we can return a cached position
mAllowed = PR_TRUE;
nsCOMPtr<nsIRunnable> ev = new RequestSendLocationEvent(lastPosition, this, mLocator);
nsCOMPtr<nsIRunnable> ev =
new RequestSendLocationEvent(lastPosition, this,
mIsWatchPositionRequest ? nsnull : mLocator);
NS_DispatchToMainThread(ev);
}
@ -462,7 +464,9 @@ nsGeolocationRequest::SendLocation(nsIDOMGeoPosition* aPosition)
void
nsGeolocationRequest::Update(nsIDOMGeoPosition* aPosition)
{
nsCOMPtr<nsIRunnable> ev = new RequestSendLocationEvent(aPosition, this);
nsCOMPtr<nsIRunnable> ev =
new RequestSendLocationEvent(aPosition, this,
mIsWatchPositionRequest ? nsnull : mLocator);
NS_DispatchToMainThread(ev);
}