Bug 1145057 - Block drawImage() from EME media. r=roc
☠☠ backed out by acf6c6ddfbb1 ☠ ☠
authorJW Wang <jwwang@mozilla.com>
Thu, 19 Mar 2015 19:08:00 -0400
changeset 263599 9a5f8a7ad4791df6f6bdbbcbbcd0776098303527
parent 263598 1eb641d3b68e8e6f2f2c9b60e0e105902bf5974c
child 263600 3b5b22189fcf35c0342190f4fcd289084b000c45
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1145057
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1145057 - Block drawImage() from EME media. r=roc
dom/canvas/CanvasRenderingContext2D.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -4213,16 +4213,21 @@ CanvasRenderingContext2D::DrawImage(cons
       gfxPlatform::GetPlatform()->GetSkiaGLGlue()) {
     mozilla::gl::GLContext* gl = gfxPlatform::GetPlatform()->GetSkiaGLGlue()->GetGLContext();
 
     HTMLVideoElement* video = &image.GetAsHTMLVideoElement();
     if (!video) {
       return;
     }
 
+    if (video->ContainsRestrictedContent()) {
+      error.Throw(NS_ERROR_NOT_AVAILABLE);
+      return;
+    }
+
     uint16_t readyState;
     if (NS_SUCCEEDED(video->GetReadyState(&readyState)) &&
         readyState < nsIDOMHTMLMediaElement::HAVE_CURRENT_DATA) {
       // still loading, just return
       return;
     }
 
     // If it doesn't have a principal, just bail