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:
@@ -36,6 +36,7 @@
|
||||
#include "nsTreeSanitizer.h"
|
||||
#include "nsHtml5Module.h"
|
||||
#include "mozilla/dom/DocumentFragment.h"
|
||||
#include "nsNullPrincipal.h"
|
||||
|
||||
#define XHTML_DIV_TAG "div xmlns=\"http://www.w3.org/1999/xhtml\""
|
||||
|
||||
@@ -75,8 +76,7 @@ nsParserUtils::Sanitize(const nsAString& aFromStr,
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
NS_NewURI(getter_AddRefs(uri), "about:blank");
|
||||
nsCOMPtr<nsIPrincipal> principal =
|
||||
do_CreateInstance("@mozilla.org/nullprincipal;1");
|
||||
nsCOMPtr<nsIPrincipal> principal = nsNullPrincipal::Create();
|
||||
nsCOMPtr<nsIDOMDocument> domDocument;
|
||||
nsresult rv = NS_NewDOMDocument(getter_AddRefs(domDocument),
|
||||
EmptyString(),
|
||||
|
||||
Reference in New Issue
Block a user