Bug 1294620 - Use infallible XPIDL attribute getters more. r=erahm.

This makes a lot of code more compact, and also avoids some redundant nsresult
checks.

The patch also removes a handful of redundant checks on infallible setters.
This commit is contained in:
Nicholas Nethercote
2016-08-12 15:19:29 +10:00
parent b31825febc
commit 1cef4f427a
36 changed files with 67 additions and 185 deletions

View File

@@ -196,19 +196,15 @@ nsGenericHTMLFrameElement::GetParentApplication(mozIApplication** aApplication)
*aApplication = nullptr;
uint32_t appId;
nsIPrincipal *principal = NodePrincipal();
nsresult rv = principal->GetAppId(&appId);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
uint32_t appId = principal->GetAppId();
nsCOMPtr<nsIAppsService> appsService = do_GetService(APPS_SERVICE_CONTRACTID);
if (NS_WARN_IF(!appsService)) {
return NS_ERROR_FAILURE;
}
rv = appsService->GetAppByLocalId(appId, aApplication);
nsresult rv = appsService->GetAppByLocalId(appId, aApplication);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}