Bug 697132 - Use nsCOMPtr constructor. r=Ms2ger

This commit is contained in:
Kan-Ru Chen 2012-03-14 18:00:29 -04:00
parent bb310a3fde
commit 0463d2d1c5
2 changed files with 2 additions and 4 deletions

View File

@ -972,8 +972,7 @@ Navigator::GetMozPower(nsIDOMMozPowerManager** aPower)
mPowerManager->Init(win);
}
nsCOMPtr<nsIDOMMozPowerManager> power =
do_QueryInterface(NS_ISUPPORTS_CAST(nsIDOMMozPowerManager*, mPowerManager));
nsCOMPtr<nsIDOMMozPowerManager> power(mPowerManager);
power.forget(aPower);
return NS_OK;

View File

@ -163,8 +163,7 @@ PowerManagerService::NewWakeLock(const nsAString &aTopic,
nsresult rv = wakelock->Init(aTopic, aWindow);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMMozWakeLock> wl =
do_QueryInterface(NS_ISUPPORTS_CAST(nsIDOMMozWakeLock*, wakelock));
nsCOMPtr<nsIDOMMozWakeLock> wl(wakelock);
wl.forget(aWakeLock);
return NS_OK;