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:
@@ -430,9 +430,8 @@ nsresult nsJSChannel::Init(nsIURI *aURI)
|
||||
// and the underlying Input Stream will not be created...
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
|
||||
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);
|
||||
|
||||
// If the resultant script evaluation actually does return a value, we
|
||||
// treat it as html.
|
||||
|
||||
Reference in New Issue
Block a user