Issue #2736 - Part 8: Re-work <video> and <audio> src attribute.

Use subject principal as triggering principal in <video>/<audio> "src"
attribute. We deviate from Mozilla here because we do not worry
about content isolation principals in Page Info.
This commit is contained in:
Moonchild 2025-04-29 21:28:50 +02:00 committed by roytam1
commit b6bdce6f98
3 changed files with 13 additions and 4 deletions

View file

@ -410,10 +410,13 @@ public:
MediaError* GetError() const;
// XPCOM GetSrc() is OK
void SetSrc(const nsAString& aSrc, ErrorResult& aRv)
void GetSrc(nsString& aSrc, nsIPrincipal&)
{
SetHTMLAttr(nsGkAtoms::src, aSrc, aRv);
GetSrc(aSrc); // XPCOM
}
void SetSrc(const nsAString& aSrc, nsIPrincipal& aTriggeringPrincipal, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::src, aSrc, aTriggeringPrincipal, aRv);
}
// XPCOM GetCurrentSrc() is OK
@ -1326,6 +1329,9 @@ protected:
// set in the src attribute.
RefPtr<DOMMediaStream> mSrcAttrStream;
// Holds the triggering principal for the src attribute.
nsCOMPtr<nsIPrincipal> mSrcAttrTriggeringPrincipal;
// Holds a reference to the DOM wrapper for the MediaStream that we're
// actually playing.
// At most one of mDecoder and mSrcStream can be non-null.