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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user