Bug 1177793 - Pass principal instead of forcing black when capturing cross-origin media resource. r=jya,jib
Differential Revision: https://phabricator.services.mozilla.com/D36896
This commit is contained in:
@@ -456,15 +456,6 @@ class HTMLMediaElement::StreamCaptureTrackSource
|
||||
return MediaSourceEnum::Other;
|
||||
}
|
||||
|
||||
CORSMode GetCORSMode() const override {
|
||||
if (!mCapturedTrackSource) {
|
||||
// This could happen during shutdown.
|
||||
return CORS_NONE;
|
||||
}
|
||||
|
||||
return mCapturedTrackSource->GetCORSMode();
|
||||
}
|
||||
|
||||
void Stop() override {
|
||||
if (mElement && mElement->mSrcStream) {
|
||||
// Only notify if we're still playing the source stream. GC might have
|
||||
@@ -4527,9 +4518,6 @@ nsresult HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder) {
|
||||
#endif
|
||||
}
|
||||
|
||||
// Set CORSMode now before any streams are added. It won't change over time.
|
||||
mDecoder->SetOutputStreamCORSMode(mCORSMode);
|
||||
|
||||
if (!mOutputStreams.IsEmpty()) {
|
||||
mDecoder->SetNextOutputStreamTrackID(
|
||||
mNextAvailableMediaDecoderOutputTrackID);
|
||||
@@ -5912,8 +5900,10 @@ already_AddRefed<nsIPrincipal> HTMLMediaElement::GetCurrentVideoPrincipal() {
|
||||
|
||||
void HTMLMediaElement::NotifyDecoderPrincipalChanged() {
|
||||
RefPtr<nsIPrincipal> principal = GetCurrentPrincipal();
|
||||
|
||||
mDecoder->UpdateSameOriginStatus(!principal || IsCORSSameOrigin());
|
||||
bool isSameOrigin = !principal || IsCORSSameOrigin();
|
||||
mDecoder->UpdateSameOriginStatus(isSameOrigin);
|
||||
mDecoder->SetOutputStreamPrincipal(isSameOrigin ? NodePrincipal()
|
||||
: principal.get());
|
||||
}
|
||||
|
||||
void HTMLMediaElement::Invalidate(bool aImageSizeChanged,
|
||||
|
||||
Reference in New Issue
Block a user