Bug 1490257 - Add triggeringPrincipal to missing cpp loads. r=ckerschb

Depends on D10883

Differential Revision: https://phabricator.services.mozilla.com/D10884

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jonathan Kingston 2018-11-05 14:03:47 +00:00
parent 42bd423a94
commit 65e7432dba
2 changed files with 6 additions and 1 deletions

View File

@ -50,6 +50,7 @@ using mozilla::DefaultXDisplay;
#include "nsIContentInlines.h"
#include "mozilla/MiscEvents.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/NullPrincipal.h"
#include "mozilla/TextEvents.h"
#include "mozilla/dom/DragEvent.h"
#include "mozilla/dom/Element.h"
@ -482,6 +483,8 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL,
mozilla::OriginAttributes attrs =
BasePrincipal::Cast(content->NodePrincipal())->OriginAttributesRef();
triggeringPrincipal = BasePrincipal::CreateCodebasePrincipal(uri, attrs);
} else {
triggeringPrincipal = NullPrincipal::CreateWithInheritedAttributes(content->NodePrincipal());
}
rv = lh->OnLinkClick(content, uri, unitarget.get(), VoidString(),

View File

@ -60,6 +60,7 @@
#include "nsSandboxFlags.h"
#include "nsSimpleEnumerator.h"
#include "mozilla/CheckedInt.h"
#include "mozilla/NullPrincipal.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/Storage.h"
@ -1033,9 +1034,10 @@ nsWindowWatcher::OpenWindowInternal(mozIDOMWindowProxy* aParent,
// Note: The check for the current JSContext isn't necessarily sensical.
// It's just designed to preserve old semantics during a mass-conversion
// patch.
// Bug 1498605 verify usages of systemPrincipal here
nsCOMPtr<nsIPrincipal> subjectPrincipal =
nsContentUtils::GetCurrentJSContext() ? nsContentUtils::SubjectPrincipal() :
nullptr;
nsContentUtils::GetSystemPrincipal();
bool isPrivateBrowsingWindow = false;