Commit de22dbae authored by Yutaka Hirano's avatar Yutaka Hirano Committed by Commit Bot

Remove SecurityOrigin param from HTMLMediaElement::IsMediaCORSSameOrigin

It's now not used.

Bug: 875153
Change-Id: Ia7d42f503617563c1d4e82c9eaa0c67aae36baa1
Reviewed-on: https://chromium-review.googlesource.com/c/1275487Reviewed-by: default avatarJohn Rummell <jrummell@chromium.org>
Reviewed-by: default avatarEmircan Uysaler <emircan@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599590}
parent 467f2d99
......@@ -1492,8 +1492,7 @@ bool HTMLMediaElement::IsSafeToLoadURL(const KURL& url,
return true;
}
bool HTMLMediaElement::IsMediaDataCORSSameOrigin(
const SecurityOrigin* origin) const {
bool HTMLMediaElement::IsMediaDataCORSSameOrigin() const {
if (!GetWebMediaPlayer())
return true;
......@@ -4255,8 +4254,8 @@ void HTMLMediaElement::RequestPause() {
}
bool HTMLMediaElement::MediaShouldBeOpaque() const {
return !IsMediaDataCORSSameOrigin(GetDocument().GetSecurityOrigin()) &&
ready_state_ < kHaveMetadata && !FastGetAttribute(srcAttr).IsEmpty() &&
return !IsMediaDataCORSSameOrigin() && ready_state_ < kHaveMetadata &&
!FastGetAttribute(srcAttr).IsEmpty() &&
EffectivePreloadType() != WebMediaPlayer::kPreloadNone;
}
......
......@@ -298,9 +298,8 @@ class CORE_EXPORT HTMLMediaElement
enum InvalidURLAction { kDoNothing, kComplain };
bool IsSafeToLoadURL(const KURL&, InvalidURLAction);
// Checks to see if current media data is CORS-same-origin as the
// specified origin.
bool IsMediaDataCORSSameOrigin(const SecurityOrigin*) const;
// Checks to see if current media data is CORS-same-origin.
bool IsMediaDataCORSSameOrigin() const;
// Returns this media element is in a cross-origin frame.
bool IsInCrossOriginFrame() const;
......
......@@ -582,9 +582,8 @@ scoped_refptr<Image> HTMLVideoElement::GetSourceImageForCanvas(
return snapshot;
}
bool HTMLVideoElement::WouldTaintOrigin(
const SecurityOrigin* destination_security_origin) const {
return !IsMediaDataCORSSameOrigin(destination_security_origin);
bool HTMLVideoElement::WouldTaintOrigin(const SecurityOrigin*) const {
return !IsMediaDataCORSSameOrigin();
}
FloatSize HTMLVideoElement::ElementSize(const FloatSize&) const {
......
......@@ -409,8 +409,7 @@ void HTMLMediaElementEncryptedMedia::Encrypted(
DVLOG(EME_LOG_LEVEL) << __func__;
Event* event;
if (media_element_->IsMediaDataCORSSameOrigin(
media_element_->GetExecutionContext()->GetSecurityOrigin())) {
if (media_element_->IsMediaDataCORSSameOrigin()) {
event = CreateEncryptedEvent(init_data_type, init_data, init_data_length);
} else {
// Current page is not allowed to see content from the media file,
......
......@@ -125,8 +125,7 @@ void MediaElementEventListener::UpdateSources(ExecutionContext* context) {
sources_.insert(track->Component()->Source());
if (!media_element_->currentSrc().IsEmpty() &&
!media_element_->IsMediaDataCORSSameOrigin(
context->GetSecurityOrigin())) {
!media_element_->IsMediaDataCORSSameOrigin()) {
for (auto source : sources_)
MediaStreamCenter::Instance().DidStopMediaStreamSource(source);
}
......@@ -156,8 +155,7 @@ MediaStream* HTMLMediaElementCapture::captureStream(
}
ExecutionContext* context = ExecutionContext::From(script_state);
if (!element.currentSrc().IsEmpty() &&
!element.IsMediaDataCORSSameOrigin(context->GetSecurityOrigin())) {
if (!element.currentSrc().IsEmpty() && !element.IsMediaDataCORSSameOrigin()) {
exception_state.ThrowSecurityError(
"Cannot capture from element with cross-origin data");
return nullptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment