Bug 1153988 - create nsNullPrincipals directly, rather than going through do_CreateInstance; r=smaug

There's a better way to create null principals than
do_CreateInstance("@mozilla.org/nullprincipal;1").  Let's do that and
save ourselves some XPCOM overhead.
This commit is contained in:
Nathan Froyd
2015-04-13 14:47:41 -04:00
parent 2d0efd09c4
commit 8fccbf9246
21 changed files with 52 additions and 59 deletions

View File

@@ -115,9 +115,8 @@ nsRDFXMLParser::ParseString(nsIRDFDataSource* aSink, nsIURI* aBaseURI, const nsA
rv = NS_NewCStringInputStream(getter_AddRefs(stream), aString);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIPrincipal> nullPrincipal =
do_CreateInstance("@mozilla.org/nullprincipal;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIPrincipal> nullPrincipal = nsNullPrincipal::Create();
NS_ENSURE_TRUE(nullPrincipal, NS_ERROR_FAILURE);
nsCOMPtr<nsIChannel> channel;
rv = NS_NewInputStreamChannel(getter_AddRefs(channel),