Backed out changeset ebaa0a4d35a3 (bug 813758) due to bug 817758.

This commit is contained in:
Ryan VanderMeulen 2012-12-03 19:03:16 -05:00
parent ccdbc2ba3d
commit d7a27c19af

View File

@ -1833,9 +1833,6 @@ ContentParent::RecvAsyncMessage(const nsString& aMsg,
bool
ContentParent::RecvAddGeolocationListener()
{
if (!AssertAppProcessPermission(this, "geolocation")) {
return false;
}
if (mGeolocationWatchID == -1) {
nsCOMPtr<nsIDOMGeoGeolocation> geo = do_GetService("@mozilla.org/geolocation;1");
if (!geo) {
@ -1850,28 +1847,20 @@ ContentParent::RecvAddGeolocationListener()
bool
ContentParent::RecvRemoveGeolocationListener()
{
if (mGeolocationWatchID == -1) {
return true;
if (mGeolocationWatchID != -1) {
nsCOMPtr<nsIDOMGeoGeolocation> geo = do_GetService("@mozilla.org/geolocation;1");
if (!geo) {
return true;
}
geo->ClearWatch(mGeolocationWatchID);
mGeolocationWatchID = -1;
}
if (!AssertAppProcessPermission(this, "geolocation")) {
return false;
}
nsCOMPtr<nsIDOMGeoGeolocation> geo = do_GetService("@mozilla.org/geolocation;1");
if (!geo) {
return true;
}
geo->ClearWatch(mGeolocationWatchID);
mGeolocationWatchID = -1;
return true;
}
NS_IMETHODIMP
ContentParent::HandleEvent(nsIDOMGeoPosition* postion)
{
if (!AssertAppProcessPermission(this, "geolocation")) {
return NS_ERROR_FAILURE;
}
unused << SendGeolocationUpdate(GeoPosition(postion));
return NS_OK;
}