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:
@@ -91,6 +91,7 @@
|
||||
#include "nsIImageLoadingContent.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsVersionComparator.h"
|
||||
#include "nsNullPrincipal.h"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
#include "nsIWindowMediator.h"
|
||||
@@ -3117,8 +3118,8 @@ nsresult nsPluginHost::NewPluginURLStream(const nsString& aURL,
|
||||
// in this else branch we really don't know where the load is coming
|
||||
// from and in fact should use something better than just using
|
||||
// a nullPrincipal as the loadingPrincipal.
|
||||
principal = do_CreateInstance("@mozilla.org/nullprincipal;1", &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
principal = nsNullPrincipal::Create();
|
||||
NS_ENSURE_TRUE(principal, NS_ERROR_FAILURE);
|
||||
rv = NS_NewChannel(getter_AddRefs(channel),
|
||||
url,
|
||||
principal,
|
||||
|
||||
Reference in New Issue
Block a user