Bug 736400 - Make each decoder Clone() method check if its mimetype is enabled r=cpearce
☠☠ backed out by 9f417cb5cd16 ☠ ☠
authorChristopher De Cairos
Mon, 26 Mar 2012 10:48:40 +1300
changeset 93592 c4a4b0171b99299ebd17218fe38fa68f6e7d4a31
parent 93591 5574b6eadb139dbd0b714edc98e7cf5945aa79dc
child 93593 9f417cb5cd16f0083bda275b29c3ceec2fd045f2
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs736400
milestone14.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 736400 - Make each decoder Clone() method check if its mimetype is enabled r=cpearce
content/media/ogg/nsOggDecoder.h
content/media/raw/nsRawDecoder.h
content/media/wave/nsWaveDecoder.h
content/media/webm/nsWebMDecoder.h
--- a/content/media/ogg/nsOggDecoder.h
+++ b/content/media/ogg/nsOggDecoder.h
@@ -39,13 +39,18 @@
 #if !defined(nsOggDecoder_h_)
 #define nsOggDecoder_h_
 
 #include "nsBuiltinDecoder.h"
 
 class nsOggDecoder : public nsBuiltinDecoder
 {
 public:
-  virtual nsMediaDecoder* Clone() { return new nsOggDecoder(); }
+  virtual nsMediaDecoder* Clone() {
+    if (!nsHTMLMediaElement::IsOggEnabled()) {
+      return nsnull;
+    }
+    return new nsOggDecoder();
+  }
   virtual nsDecoderStateMachine* CreateStateMachine();
 };
 
 #endif
--- a/content/media/raw/nsRawDecoder.h
+++ b/content/media/raw/nsRawDecoder.h
@@ -37,13 +37,18 @@
 #if !defined(nsRawDecoder_h_)
 #define nsRawDecoder_h_
 
 #include "nsBuiltinDecoder.h"
 
 class nsRawDecoder : public nsBuiltinDecoder
 {
 public:
-  virtual nsMediaDecoder* Clone() { return new nsRawDecoder(); }
+  virtual nsMediaDecoder* Clone() { 
+    if (!nsHTMLMediaElement::IsRawEnabled()) {
+      return nsnull;
+    }    
+    return new nsRawDecoder();
+  }
   virtual nsDecoderStateMachine* CreateStateMachine();
 };
 
 #endif
--- a/content/media/wave/nsWaveDecoder.h
+++ b/content/media/wave/nsWaveDecoder.h
@@ -50,13 +50,18 @@
  * require extending nsWaveDecoder to support parsing the newer
  * WAVE_FORMAT_EXTENSIBLE chunk format.
 **/
 
 
 class nsWaveDecoder : public nsBuiltinDecoder
 {
 public:
-   virtual nsMediaDecoder* Clone() { return new nsWaveDecoder(); }
-   virtual nsDecoderStateMachine* CreateStateMachine();
+  virtual nsMediaDecoder* Clone() {
+    if (!nsHTMLMediaElement::IsWaveEnabled()) {
+      return nsnull;
+    }
+    return new nsWaveDecoder();
+  }
+  virtual nsDecoderStateMachine* CreateStateMachine();
 };
 
 #endif
--- a/content/media/webm/nsWebMDecoder.h
+++ b/content/media/webm/nsWebMDecoder.h
@@ -39,13 +39,18 @@
 #if !defined(nsWebMDecoder_h_)
 #define nsWebMDecoder_h_
 
 #include "nsBuiltinDecoder.h"
 
 class nsWebMDecoder : public nsBuiltinDecoder
 {
 public:
-  virtual nsMediaDecoder* Clone() { return new nsWebMDecoder(); }
+  virtual nsMediaDecoder* Clone() {
+    if (!nsHTMLMediaElement::IsWebMEnabled()) {
+      return nsnull;
+    }
+    return new nsWebMDecoder();
+  }
   virtual nsDecoderStateMachine* CreateStateMachine();
 };
 
 #endif