Bug 1308600 - Remove unused ServiceReady method from Geolocation. r=jdm

This commit is contained in:
Adam Velebil 2016-10-10 23:15:45 +02:00
Родитель 2151007a86
Коммит 13e0da5f08
2 изменённых файлов: 4 добавлений и 37 удалений

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

@ -1247,14 +1247,8 @@ Geolocation::GetCurrentPosition(GeoPositionCallback callback,
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
return GetCurrentPositionReady(request);
}
nsresult
Geolocation::GetCurrentPositionReady(nsGeolocationRequest* aRequest)
{
if (mOwner) { if (mOwner) {
if (!RegisterRequestWithPrompt(aRequest)) { if (!RegisterRequestWithPrompt(request)) {
return NS_ERROR_NOT_AVAILABLE; return NS_ERROR_NOT_AVAILABLE;
} }
@ -1265,7 +1259,7 @@ Geolocation::GetCurrentPositionReady(nsGeolocationRequest* aRequest)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
nsCOMPtr<nsIRunnable> ev = new RequestAllowEvent(true, aRequest); nsCOMPtr<nsIRunnable> ev = new RequestAllowEvent(true, request);
NS_DispatchToMainThread(ev); NS_DispatchToMainThread(ev);
return NS_OK; return NS_OK;
@ -1334,14 +1328,8 @@ Geolocation::WatchPosition(GeoPositionCallback aCallback,
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
return WatchPositionReady(request);
}
nsresult
Geolocation::WatchPositionReady(nsGeolocationRequest* aRequest)
{
if (mOwner) { if (mOwner) {
if (!RegisterRequestWithPrompt(aRequest)) if (!RegisterRequestWithPrompt(request))
return NS_ERROR_NOT_AVAILABLE; return NS_ERROR_NOT_AVAILABLE;
return NS_OK; return NS_OK;
@ -1351,7 +1339,7 @@ Geolocation::WatchPositionReady(nsGeolocationRequest* aRequest)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
aRequest->Allow(JS::UndefinedHandleValue); request->Allow(JS::UndefinedHandleValue);
return NS_OK; return NS_OK;
} }
@ -1390,20 +1378,6 @@ Geolocation::ClearWatch(int32_t aWatchId)
return NS_OK; return NS_OK;
} }
void
Geolocation::ServiceReady()
{
for (uint32_t length = mPendingRequests.Length(); length > 0; --length) {
if (mPendingRequests[0]->IsWatch()) {
WatchPositionReady(mPendingRequests[0]);
} else {
GetCurrentPositionReady(mPendingRequests[0]);
}
mPendingRequests.RemoveElementAt(0);
}
}
bool bool
Geolocation::WindowOwnerStillExists() Geolocation::WindowOwnerStillExists()
{ {

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

@ -171,9 +171,6 @@ public:
// Check to see if any active request requires high accuracy // Check to see if any active request requires high accuracy
bool HighAccuracyRequested(); bool HighAccuracyRequested();
// Notification from the service:
void ServiceReady();
private: private:
~Geolocation(); ~Geolocation();
@ -187,10 +184,6 @@ private:
bool RegisterRequestWithPrompt(nsGeolocationRequest* request); bool RegisterRequestWithPrompt(nsGeolocationRequest* request);
// Methods for the service when it's ready to process requests:
nsresult GetCurrentPositionReady(nsGeolocationRequest* aRequest);
nsresult WatchPositionReady(nsGeolocationRequest* aRequest);
// Check if clearWatch is already called // Check if clearWatch is already called
bool IsAlreadyCleared(nsGeolocationRequest* aRequest); bool IsAlreadyCleared(nsGeolocationRequest* aRequest);