Bug 1671367 - Add overloads of NS_NewLocal*FileStream functions returning a Result and use them. r=dom-workers-and-storage-reviewers,necko-reviewers,asuth

Differential Revision: https://phabricator.services.mozilla.com/D94138
This commit is contained in:
Simon Giesecke
2020-11-17 19:30:05 +00:00
parent 3d8e212baf
commit 567587d2dd
7 changed files with 98 additions and 53 deletions

View File

@@ -781,9 +781,9 @@ Result<nsCOMPtr<nsIInputStream>, nsresult> ExtensionProtocolHandler::NewStream(
}
nsCOMPtr<nsIInputStream> inputStream;
MOZ_TRY(NS_NewLocalFileInputStream(getter_AddRefs(inputStream), requestedFile,
PR_RDONLY, -1,
nsIFileInputStream::DEFER_OPEN));
MOZ_TRY_VAR(inputStream,
NS_NewLocalFileInputStream(requestedFile, PR_RDONLY, -1,
nsIFileInputStream::DEFER_OPEN));
return inputStream;
}