Bug 968479 - Remove the media.webaudio.enabled pref; r=roc

--HG--
extra : rebase_source : 3618cb3097aa99a79a06af016bf6b3a3c6f77208
This commit is contained in:
Ehsan Akhgari 2014-02-06 08:36:46 -05:00
parent f998a7abde
commit 95cbd5d2b1
39 changed files with 11 additions and 118 deletions

View File

@ -39,7 +39,7 @@ load 878407.html
load 878478.html load 878478.html
load 877527.html load 877527.html
load 880129.html load 880129.html
skip-if(B2G) test-pref(media.webaudio.enabled,true) load 880202.html # load failed, bug 908306 for B2G skip-if(B2G) load 880202.html # load failed, bug 908306 for B2G
load 880342-1.html load 880342-1.html
load 880342-2.html load 880342-2.html
load 880384.html load 880384.html

View File

@ -10,7 +10,6 @@
#include "nsWrapperCache.h" #include "nsWrapperCache.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "EnableWebAudioCheck.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "AudioContext.h" #include "AudioContext.h"
@ -31,8 +30,7 @@ class AudioContext;
* are Float32Arrays, or in mSharedChannels if the mJSChannels objects have * are Float32Arrays, or in mSharedChannels if the mJSChannels objects have
* been neutered. * been neutered.
*/ */
class AudioBuffer MOZ_FINAL : public nsWrapperCache, class AudioBuffer MOZ_FINAL : public nsWrapperCache
public EnableWebAudioCheck
{ {
public: public:
AudioBuffer(AudioContext* aContext, uint32_t aLength, AudioBuffer(AudioContext* aContext, uint32_t aLength,

View File

@ -8,7 +8,6 @@
#define AudioContext_h_ #define AudioContext_h_
#include "mozilla/dom/AudioChannelBinding.h" #include "mozilla/dom/AudioChannelBinding.h"
#include "EnableWebAudioCheck.h"
#include "MediaBufferDecoder.h" #include "MediaBufferDecoder.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "mozilla/dom/TypedArray.h" #include "mozilla/dom/TypedArray.h"
@ -64,8 +63,7 @@ class WaveShaperNode;
class PeriodicWave; class PeriodicWave;
class AudioContext MOZ_FINAL : public nsDOMEventTargetHelper, class AudioContext MOZ_FINAL : public nsDOMEventTargetHelper,
public nsIMemoryReporter, public nsIMemoryReporter
public EnableWebAudioCheck
{ {
AudioContext(nsPIDOMWindow* aParentWindow, AudioContext(nsPIDOMWindow* aParentWindow,
bool aIsOffline, bool aIsOffline,

View File

@ -10,7 +10,6 @@
#include "nsWrapperCache.h" #include "nsWrapperCache.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "EnableWebAudioCheck.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "ThreeDPoint.h" #include "ThreeDPoint.h"
#include "AudioContext.h" #include "AudioContext.h"
@ -23,8 +22,7 @@ namespace mozilla {
namespace dom { namespace dom {
class AudioListener MOZ_FINAL : public nsWrapperCache, class AudioListener MOZ_FINAL : public nsWrapperCache
public EnableWebAudioCheck
{ {
public: public:
explicit AudioListener(AudioContext* aContext); explicit AudioListener(AudioContext* aContext);

View File

@ -10,7 +10,6 @@
#include "nsDOMEventTargetHelper.h" #include "nsDOMEventTargetHelper.h"
#include "mozilla/dom/AudioNodeBinding.h" #include "mozilla/dom/AudioNodeBinding.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "EnableWebAudioCheck.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "AudioContext.h" #include "AudioContext.h"
@ -82,8 +81,7 @@ private:
* still alive, and will still be alive when it receives a message from the * still alive, and will still be alive when it receives a message from the
* engine. * engine.
*/ */
class AudioNode : public nsDOMEventTargetHelper, class AudioNode : public nsDOMEventTargetHelper
public EnableWebAudioCheck
{ {
protected: protected:
// You can only use refcounting to delete this object // You can only use refcounting to delete this object

View File

@ -10,7 +10,6 @@
#include "AudioParamTimeline.h" #include "AudioParamTimeline.h"
#include "nsWrapperCache.h" #include "nsWrapperCache.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "EnableWebAudioCheck.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "AudioNode.h" #include "AudioNode.h"
#include "mozilla/dom/TypedArray.h" #include "mozilla/dom/TypedArray.h"
@ -22,7 +21,6 @@ namespace mozilla {
namespace dom { namespace dom {
class AudioParam MOZ_FINAL : public nsWrapperCache, class AudioParam MOZ_FINAL : public nsWrapperCache,
public EnableWebAudioCheck,
public AudioParamTimeline public AudioParamTimeline
{ {
public: public:

View File

@ -14,8 +14,7 @@
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
class AudioProcessingEvent : public nsDOMEvent, class AudioProcessingEvent : public nsDOMEvent
public EnableWebAudioCheck
{ {
public: public:
AudioProcessingEvent(ScriptProcessorNode* aOwner, AudioProcessingEvent(ScriptProcessorNode* aOwner,

View File

@ -1,32 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "EnableWebAudioCheck.h"
#include "mozilla/Preferences.h"
namespace {
bool gPrefInitialized = false;
bool gWebAudioEnabled = false;
}
namespace mozilla {
namespace dom {
/* static */ bool
EnableWebAudioCheck::PrefEnabled()
{
if (!gPrefInitialized) {
Preferences::AddBoolVarCache(&gWebAudioEnabled, "media.webaudio.enabled");
gPrefInitialized = true;
}
return gWebAudioEnabled;
}
}
}

View File

@ -1,24 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef EnableWebAudioCheck_h_
#define EnableWebAudioCheck_h_
namespace mozilla {
namespace dom {
// This is a helper class which enables Web Audio to be enabled or disabled
// as whole. Individual Web Audio object classes should inherit from this.
class EnableWebAudioCheck {
public:
static bool PrefEnabled();
};
}
}
#endif

View File

@ -15,8 +15,7 @@ namespace dom {
class AudioContext; class AudioContext;
class OfflineAudioCompletionEvent : public nsDOMEvent, class OfflineAudioCompletionEvent : public nsDOMEvent
public EnableWebAudioCheck
{ {
public: public:
OfflineAudioCompletionEvent(AudioContext* aOwner, OfflineAudioCompletionEvent(AudioContext* aOwner,

View File

@ -10,7 +10,6 @@
#include "nsWrapperCache.h" #include "nsWrapperCache.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "EnableWebAudioCheck.h"
#include "AudioContext.h" #include "AudioContext.h"
#include "AudioNodeEngine.h" #include "AudioNodeEngine.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
@ -19,8 +18,7 @@ namespace mozilla {
namespace dom { namespace dom {
class PeriodicWave MOZ_FINAL : public nsWrapperCache, class PeriodicWave MOZ_FINAL : public nsWrapperCache
public EnableWebAudioCheck
{ {
public: public:
PeriodicWave(AudioContext* aContext, PeriodicWave(AudioContext* aContext,

View File

@ -36,7 +36,6 @@ EXPORTS.mozilla.dom += [
'ConvolverNode.h', 'ConvolverNode.h',
'DelayNode.h', 'DelayNode.h',
'DynamicsCompressorNode.h', 'DynamicsCompressorNode.h',
'EnableWebAudioCheck.h',
'GainNode.h', 'GainNode.h',
'MediaElementAudioSourceNode.h', 'MediaElementAudioSourceNode.h',
'MediaStreamAudioDestinationNode.h', 'MediaStreamAudioDestinationNode.h',
@ -66,7 +65,6 @@ UNIFIED_SOURCES += [
'DelayNode.cpp', 'DelayNode.cpp',
'DelayProcessor.cpp', 'DelayProcessor.cpp',
'DynamicsCompressorNode.cpp', 'DynamicsCompressorNode.cpp',
'EnableWebAudioCheck.cpp',
'FFTBlock.cpp', 'FFTBlock.cpp',
'GainNode.cpp', 'GainNode.cpp',
'MediaBufferDecoder.cpp', 'MediaBufferDecoder.cpp',

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface AnalyserNode : AudioNode { interface AnalyserNode : AudioNode {
// Real-time frequency-domain data // Real-time frequency-domain data

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface AudioBuffer { interface AudioBuffer {
readonly attribute float sampleRate; readonly attribute float sampleRate;

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface AudioBufferSourceNode : AudioNode { interface AudioBufferSourceNode : AudioNode {
attribute AudioBuffer? buffer; attribute AudioBuffer? buffer;
@ -34,7 +33,6 @@ interface AudioBufferSourceNode : AudioNode {
* The origin of this IDL file is * The origin of this IDL file is
* https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
*/ */
[PrefControlled]
partial interface AudioBufferSourceNode { partial interface AudioBufferSourceNode {
// Same as start() // Same as start()
[Throws,Pref="media.webaudio.legacy.AudioBufferSourceNode"] [Throws,Pref="media.webaudio.legacy.AudioBufferSourceNode"]

View File

@ -13,7 +13,7 @@
callback DecodeSuccessCallback = void (AudioBuffer decodedData); callback DecodeSuccessCallback = void (AudioBuffer decodedData);
callback DecodeErrorCallback = void (); callback DecodeErrorCallback = void ();
[Constructor, PrefControlled] [Constructor]
interface AudioContext : EventTarget { interface AudioContext : EventTarget {
readonly attribute AudioDestinationNode destination; readonly attribute AudioDestinationNode destination;
@ -78,7 +78,6 @@ interface AudioContext : EventTarget {
* The origin of this IDL file is * The origin of this IDL file is
* https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
*/ */
[PrefControlled]
partial interface AudioContext { partial interface AudioContext {
[NewObject, Throws] [NewObject, Throws]
AudioBuffer? createBuffer(ArrayBuffer buffer, boolean mixToMono); AudioBuffer? createBuffer(ArrayBuffer buffer, boolean mixToMono);

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface AudioDestinationNode : AudioNode { interface AudioDestinationNode : AudioNode {
readonly attribute unsigned long maxChannelCount; readonly attribute unsigned long maxChannelCount;

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface AudioListener { interface AudioListener {
// same as OpenAL (default 1) // same as OpenAL (default 1)

View File

@ -21,7 +21,6 @@ enum ChannelInterpretation {
"discrete" "discrete"
}; };
[PrefControlled]
interface AudioNode : EventTarget { interface AudioNode : EventTarget {
[Throws] [Throws]

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface AudioParam { interface AudioParam {
attribute float value; attribute float value;
@ -43,7 +42,6 @@ interface AudioParam {
* The origin of this IDL file is * The origin of this IDL file is
* https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
*/ */
[PrefControlled]
partial interface AudioParam { partial interface AudioParam {
// Same as setTargetAtTime() // Same as setTargetAtTime()
[Throws,Pref="media.webaudio.legacy.AudioParam"] [Throws,Pref="media.webaudio.legacy.AudioParam"]

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface AudioProcessingEvent : Event { interface AudioProcessingEvent : Event {
readonly attribute double playbackTime; readonly attribute double playbackTime;

View File

@ -24,7 +24,6 @@ enum BiquadFilterType {
"allpass" "allpass"
}; };
[PrefControlled]
interface BiquadFilterNode : AudioNode { interface BiquadFilterNode : AudioNode {
attribute BiquadFilterType type; attribute BiquadFilterType type;
@ -43,7 +42,6 @@ interface BiquadFilterNode : AudioNode {
* The origin of this IDL file is * The origin of this IDL file is
* https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
*/ */
[PrefControlled]
partial interface BiquadFilterNode { partial interface BiquadFilterNode {
[Pref="media.webaudio.legacy.BiquadFilterNode"] [Pref="media.webaudio.legacy.BiquadFilterNode"]
const unsigned short LOWPASS = 0; const unsigned short LOWPASS = 0;

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface ChannelMergerNode : AudioNode { interface ChannelMergerNode : AudioNode {
}; };

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface ChannelSplitterNode : AudioNode { interface ChannelSplitterNode : AudioNode {
}; };

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface ConvolverNode : AudioNode { interface ConvolverNode : AudioNode {
[SetterThrows] [SetterThrows]

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface DelayNode : AudioNode { interface DelayNode : AudioNode {
readonly attribute AudioParam delayTime; readonly attribute AudioParam delayTime;

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface DynamicsCompressorNode : AudioNode { interface DynamicsCompressorNode : AudioNode {
readonly attribute AudioParam threshold; // in Decibels readonly attribute AudioParam threshold; // in Decibels

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface GainNode : AudioNode { interface GainNode : AudioNode {
readonly attribute AudioParam gain; readonly attribute AudioParam gain;

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface MediaElementAudioSourceNode : AudioNode { interface MediaElementAudioSourceNode : AudioNode {
}; };

View File

@ -10,9 +10,8 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface MediaStreamAudioDestinationNode : AudioNode { interface MediaStreamAudioDestinationNode : AudioNode {
readonly attribute MediaStream stream; readonly attribute MediaStream stream;
}; };

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface OfflineAudioCompletionEvent : Event { interface OfflineAudioCompletionEvent : Event {
readonly attribute AudioBuffer renderedBuffer; readonly attribute AudioBuffer renderedBuffer;

View File

@ -12,8 +12,7 @@
callback OfflineRenderSuccessCallback = void (AudioBuffer renderedData); callback OfflineRenderSuccessCallback = void (AudioBuffer renderedData);
[Constructor(unsigned long numberOfChannels, unsigned long length, float sampleRate), [Constructor(unsigned long numberOfChannels, unsigned long length, float sampleRate)]
PrefControlled]
interface OfflineAudioContext : AudioContext { interface OfflineAudioContext : AudioContext {
[Throws] [Throws]

View File

@ -21,7 +21,6 @@ enum OscillatorType {
"custom" "custom"
}; };
[PrefControlled]
interface OscillatorNode : AudioNode { interface OscillatorNode : AudioNode {
[SetterThrows] [SetterThrows]

View File

@ -27,7 +27,6 @@ enum DistanceModelType {
"exponential" "exponential"
}; };
[PrefControlled]
interface PannerNode : AudioNode { interface PannerNode : AudioNode {
// Default for stereo is HRTF // Default for stereo is HRTF
@ -55,7 +54,6 @@ interface PannerNode : AudioNode {
* The origin of this IDL file is * The origin of this IDL file is
* https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
*/ */
[PrefControlled]
partial interface PannerNode { partial interface PannerNode {
[Pref="media.webaudio.legacy.PannerNode"] [Pref="media.webaudio.legacy.PannerNode"]
const unsigned short EQUALPOWER = 0; const unsigned short EQUALPOWER = 0;

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface PeriodicWave { interface PeriodicWave {
}; };

View File

@ -10,7 +10,6 @@
* liability, trademark and document use rules apply. * liability, trademark and document use rules apply.
*/ */
[PrefControlled]
interface ScriptProcessorNode : AudioNode { interface ScriptProcessorNode : AudioNode {
attribute EventHandler onaudioprocess; attribute EventHandler onaudioprocess;

View File

@ -16,7 +16,6 @@ enum OverSampleType {
"4x" "4x"
}; };
[PrefControlled]
interface WaveShaperNode : AudioNode { interface WaveShaperNode : AudioNode {
attribute Float32Array? curve; attribute Float32Array? curve;

View File

@ -282,9 +282,6 @@ pref("media.encoder.webm.enabled", true);
pref("media.encoder.omx.enabled", true); pref("media.encoder.omx.enabled", true);
#endif #endif
// Whether to enable Web Audio support
pref("media.webaudio.enabled", true);
// Whether to autostart a media element with an |autoplay| attribute // Whether to autostart a media element with an |autoplay| attribute
pref("media.autoplay.enabled", true); pref("media.autoplay.enabled", true);

View File

@ -130,9 +130,6 @@ user_pref("network.http.bypass-cachelock-threshold", 200000);
user_pref("dom.gamepad.enabled", true); user_pref("dom.gamepad.enabled", true);
user_pref("dom.gamepad.non_standard_events.enabled", true); user_pref("dom.gamepad.non_standard_events.enabled", true);
// Enable Web Audio
user_pref("media.webaudio.enabled", true);
// Enable Web Audio legacy APIs // Enable Web Audio legacy APIs
user_pref("media.webaudio.legacy.AudioBufferSourceNode", true); user_pref("media.webaudio.legacy.AudioBufferSourceNode", true);
user_pref("media.webaudio.legacy.AudioContext", true); user_pref("media.webaudio.legacy.AudioContext", true);