Bug 1308287 part 1. Change [NeedsSubjectPrincipal] to only do the Maybe thing for interfaces that can be exposed to workers. r=baku

The idea is to not make consumers think about whether the principal exists or
not when the caller knows for sure that it does.

The substantive changes are in dom/bindings, nsHTMLDocument::SetDesignMode, and
around the CanUseStorage bits.  Everything else is pretty mechanical.
This commit is contained in:
Boris Zbarsky
2016-10-10 21:07:48 -04:00
parent 89d7a546a8
commit 65a99191a7
33 changed files with 261 additions and 302 deletions

View File

@@ -466,13 +466,13 @@ HTMLObjectElement::GetContentDocument(nsIDOMDocument **aContentDocument)
NS_ENSURE_ARG_POINTER(aContentDocument);
nsCOMPtr<nsIDOMDocument> domDoc =
do_QueryInterface(GetContentDocument(Some(nsContentUtils::SubjectPrincipal())));
do_QueryInterface(GetContentDocument(*nsContentUtils::SubjectPrincipal()));
domDoc.forget(aContentDocument);
return NS_OK;
}
nsPIDOMWindowOuter*
HTMLObjectElement::GetContentWindow(const mozilla::Maybe<nsIPrincipal*>& aSubjectPrincipal)
HTMLObjectElement::GetContentWindow(nsIPrincipal& aSubjectPrincipal)
{
nsIDocument* doc = GetContentDocument(aSubjectPrincipal);
if (doc) {