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 877527.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-2.html
load 880384.html

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -14,8 +14,7 @@
namespace mozilla {
namespace dom {
class AudioProcessingEvent : public nsDOMEvent,
public EnableWebAudioCheck
class AudioProcessingEvent : public nsDOMEvent
{
public:
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 OfflineAudioCompletionEvent : public nsDOMEvent,
public EnableWebAudioCheck
class OfflineAudioCompletionEvent : public nsDOMEvent
{
public:
OfflineAudioCompletionEvent(AudioContext* aOwner,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -282,9 +282,6 @@ pref("media.encoder.webm.enabled", true);
pref("media.encoder.omx.enabled", true);
#endif
// Whether to enable Web Audio support
pref("media.webaudio.enabled", true);
// Whether to autostart a media element with an |autoplay| attribute
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.non_standard_events.enabled", true);
// Enable Web Audio
user_pref("media.webaudio.enabled", true);
// Enable Web Audio legacy APIs
user_pref("media.webaudio.legacy.AudioBufferSourceNode", true);
user_pref("media.webaudio.legacy.AudioContext", true);