Backed out changeset 1982ca04dbf4 (bug 1308432)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 19 Oct 2016 14:37:56 +0200
changeset 318579 b8668266c5f031847c2d9f9e4a1200ab2f2dc93a
parent 318578 6e765a5d7110c89f0a74602b8a9262fe6d15978e
child 318580 f84e984210c9366cd1de7bfccd55ef80e0fcd007
push id30844
push userphilringnalda@gmail.com
push dateThu, 20 Oct 2016 01:26:07 +0000
treeherdermozilla-central@6e1a56ec3487 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1308432
milestone52.0a1
backs out1982ca04dbf49a4c8d54e98ccdc0b818654f65aa
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
Backed out changeset 1982ca04dbf4 (bug 1308432)
dom/media/webaudio/AudioContext.cpp
dom/media/webaudio/AudioContext.h
dom/media/webaudio/ConstantSourceNode.cpp
dom/media/webaudio/ConstantSourceNode.h
dom/media/webaudio/moz.build
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/AudioContext.webidl
dom/webidl/ConstantSourceNode.webidl
dom/webidl/moz.build
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -21,17 +21,16 @@
 #include "AudioBufferSourceNode.h"
 #include "AudioChannelService.h"
 #include "AudioDestinationNode.h"
 #include "AudioListener.h"
 #include "AudioStream.h"
 #include "BiquadFilterNode.h"
 #include "ChannelMergerNode.h"
 #include "ChannelSplitterNode.h"
-#include "ConstantSourceNode.h"
 #include "ConvolverNode.h"
 #include "DelayNode.h"
 #include "DynamicsCompressorNode.h"
 #include "GainNode.h"
 #include "IIRFilterNode.h"
 #include "MediaElementAudioSourceNode.h"
 #include "MediaStreamAudioDestinationNode.h"
 #include "MediaStreamAudioSourceNode.h"
@@ -245,28 +244,16 @@ AudioContext::CreateBufferSource(ErrorRe
     return nullptr;
   }
 
   RefPtr<AudioBufferSourceNode> bufferNode =
     new AudioBufferSourceNode(this);
   return bufferNode.forget();
 }
 
-already_AddRefed<ConstantSourceNode>
-AudioContext::CreateConstantSource(ErrorResult& aRv)
-{
-  if (CheckClosed(aRv)) {
-    return nullptr;
-  }
-
-  RefPtr<ConstantSourceNode> constantSourceNode =
-    new ConstantSourceNode(this);
-  return constantSourceNode.forget();
-}
-
 already_AddRefed<AudioBuffer>
 AudioContext::CreateBuffer(uint32_t aNumberOfChannels, uint32_t aLength,
                            float aSampleRate,
                            ErrorResult& aRv)
 {
   if (!aNumberOfChannels) {
     aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
     return nullptr;
--- a/dom/media/webaudio/AudioContext.h
+++ b/dom/media/webaudio/AudioContext.h
@@ -47,17 +47,16 @@ class AnalyserNode;
 class AudioBuffer;
 class AudioBufferSourceNode;
 class AudioDestinationNode;
 class AudioListener;
 class AudioNode;
 class BiquadFilterNode;
 class ChannelMergerNode;
 class ChannelSplitterNode;
-class ConstantSourceNode;
 class ConvolverNode;
 class DelayNode;
 class DynamicsCompressorNode;
 class GainNode;
 class GlobalObject;
 class HTMLMediaElement;
 class IIRFilterNode;
 class MediaElementAudioSourceNode;
@@ -196,18 +195,16 @@ public:
   // thread and removing the reference we added.
   already_AddRefed<Promise> Suspend(ErrorResult& aRv);
   already_AddRefed<Promise> Resume(ErrorResult& aRv);
   already_AddRefed<Promise> Close(ErrorResult& aRv);
   IMPL_EVENT_HANDLER(statechange)
 
   already_AddRefed<AudioBufferSourceNode> CreateBufferSource(ErrorResult& aRv);
 
-  already_AddRefed<ConstantSourceNode> CreateConstantSource(ErrorResult& aRv);
-
   already_AddRefed<AudioBuffer>
   CreateBuffer(uint32_t aNumberOfChannels, uint32_t aLength, float aSampleRate,
                ErrorResult& aRv);
 
   already_AddRefed<MediaStreamAudioDestinationNode>
   CreateMediaStreamDestination(ErrorResult& aRv);
 
   already_AddRefed<ScriptProcessorNode>
deleted file mode 100644
--- a/dom/media/webaudio/ConstantSourceNode.cpp
+++ /dev/null
@@ -1,86 +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 "ConstantSourceNode.h"
-
-#include "AudioDestinationNode.h"
-#include "nsContentUtils.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED(ConstantSourceNode, AudioNode,
-                                   mOffset)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ConstantSourceNode)
-NS_INTERFACE_MAP_END_INHERITING(AudioNode)
-
-NS_IMPL_ADDREF_INHERITED(ConstantSourceNode, AudioNode)
-NS_IMPL_RELEASE_INHERITED(ConstantSourceNode, AudioNode)
-
-ConstantSourceNode::ConstantSourceNode(AudioContext* aContext)
-  : AudioNode(aContext,
-              1,
-              ChannelCountMode::Max,
-              ChannelInterpretation::Speakers)
-{
-}
-
-ConstantSourceNode::~ConstantSourceNode()
-{
-}
-
-size_t
-ConstantSourceNode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
-{
-  size_t amount = AudioNode::SizeOfExcludingThis(aMallocSizeOf);
-
-  amount += mOffset->SizeOfIncludingThis(aMallocSizeOf);
-  return amount;
-}
-
-size_t
-ConstantSourceNode::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
-{
-  return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
-}
-
-JSObject*
-ConstantSourceNode::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return ConstantSourceNodeBinding::Wrap(aCx, this, aGivenProto);
-}
-
-already_AddRefed<ConstantSourceNode>
-ConstantSourceNode::Constructor(const GlobalObject& aGlobal,
-                                const AudioContext& aContext,
-                                const ConstantSourceOptions& aOptions,
-                                ErrorResult& aRv)
-{
-}
-
-void
-ConstantSourceNode::DestroyMediaStream()
-{
-}
-
-void
-ConstantSourceNode::Start(double aWhen, ErrorResult& rv)
-{
-}
-
-void
-ConstantSourceNode::Stop(double aWhen, ErrorResult& rv)
-{
-}
-
-void
-ConstantSourceNode::NotifyMainThreadStreamFinished()
-{
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/media/webaudio/ConstantSourceNode.h
+++ /dev/null
@@ -1,75 +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 ConstantSourceNode_h_
-#define ConstantSourceNode_h_
-
-#include "AudioNode.h"
-#include "AudioParam.h"
-#include "mozilla/dom/ConstantSourceNodeBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-class AudioContext;
-
-class ConstantSourceNode final : public AudioNode,
-                                 public MainThreadMediaStreamListener
-{
-public:
-  explicit ConstantSourceNode(AudioContext* aContext);
-
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ConstantSourceNode, AudioNode)
-
-  JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-  static already_AddRefed<ConstantSourceNode>
-  Constructor(const GlobalObject& aGlobal,
-              const AudioContext& aContext,
-              const ConstantSourceOptions& aOptions,
-              ErrorResult& aRv);
-
-  void DestroyMediaStream() override;
-
-  uint16_t NumberOfInputs() const final override
-  {
-    return 0;
-  }
-
-  AudioParam* Offset() const
-  {
-    return mOffset;
-  }
-
-  void Start(double aWhen, ErrorResult& rv);
-  void Stop(double aWhen, ErrorResult& rv);
-
-  IMPL_EVENT_HANDLER(ended)
-
-  void NotifyMainThreadStreamFinished() override;
-
-  const char* NodeType() const override
-  {
-    return "ConstantSourceNode";
-  }
-
-  size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;
-  size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override;
-
-protected:
-  virtual ~ConstantSourceNode();
-
-private:
-  RefPtr<AudioParam> mOffset;
-
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif
-
--- a/dom/media/webaudio/moz.build
+++ b/dom/media/webaudio/moz.build
@@ -52,17 +52,16 @@ EXPORTS.mozilla.dom += [
     'AudioDestinationNode.h',
     'AudioListener.h',
     'AudioNode.h',
     'AudioParam.h',
     'AudioProcessingEvent.h',
     'BiquadFilterNode.h',
     'ChannelMergerNode.h',
     'ChannelSplitterNode.h',
-    'ConstantSourceNode.h',
     'ConvolverNode.h',
     'DelayNode.h',
     'DynamicsCompressorNode.h',
     'GainNode.h',
     'IIRFilterNode.h',
     'MediaElementAudioSourceNode.h',
     'MediaStreamAudioDestinationNode.h',
     'MediaStreamAudioSourceNode.h',
@@ -89,17 +88,16 @@ UNIFIED_SOURCES += [
     'AudioNodeExternalInputStream.cpp',
     'AudioNodeStream.cpp',
     'AudioParam.cpp',
     'AudioProcessingEvent.cpp',
     'BiquadFilterNode.cpp',
     'BufferDecoder.cpp',
     'ChannelMergerNode.cpp',
     'ChannelSplitterNode.cpp',
-    'ConstantSourceNode.cpp',
     'ConvolverNode.cpp',
     'DelayBuffer.cpp',
     'DelayNode.cpp',
     'DynamicsCompressorNode.cpp',
     'FFTBlock.cpp',
     'GainNode.cpp',
     'IIRFilterNode.cpp',
     'MediaBufferDecoder.cpp',
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -204,18 +204,16 @@ var interfaceNamesInGlobalScope =
     "CloseEvent",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "CommandEvent",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "Comment",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "CompositionEvent",
 // IMPORTANT: Do not change this list without review from a DOM peer!
-    "ConstantSourceNode",
-// IMPORTANT: Do not change this list without review from a DOM peer!
     "Controllers",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "ConvolverNode",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "Crypto",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "CryptoKey",
 // IMPORTANT: Do not change this list without review from a DOM peer!
--- a/dom/webidl/AudioContext.webidl
+++ b/dom/webidl/AudioContext.webidl
@@ -49,19 +49,16 @@ interface AudioContext : EventTarget {
                                          optional DecodeSuccessCallback successCallback,
                                          optional DecodeErrorCallback errorCallback);
 
     // AudioNode creation
     [NewObject, Throws]
     AudioBufferSourceNode createBufferSource();
 
     [NewObject, Throws]
-    ConstantSourceNode createConstantSource();
-
-    [NewObject, Throws]
     MediaStreamAudioDestinationNode createMediaStreamDestination();
 
     [NewObject, Throws]
     ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0,
                                               optional unsigned long numberOfInputChannels = 2,
                                               optional unsigned long numberOfOutputChannels = 2);
 
     [NewObject, Throws]
deleted file mode 100644
--- a/dom/webidl/ConstantSourceNode.webidl
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/.
- *
- * The origin of this IDL file is
- * https://webaudio.github.io/web-audio-api/
- *
- * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
- * liability, trademark and document use rules apply.
- */
-
-dictionary ConstantSourceOptions {
-    float offset = 1;
-};
-
-[Pref="dom.webaudio.enabled",
- Constructor(AudioContext context, optional ConstantSourceOptions options)]
-interface ConstantSourceNode : AudioNode {
-    readonly        attribute AudioParam   offset;
-                    attribute EventHandler onended;
-    [Throws, UnsafeInPrerendering]
-    void start (optional double when = 0);
-    [Throws, UnsafeInPrerendering]
-    void stop (optional double when = 0);
-};
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -77,17 +77,16 @@ WEBIDL_FILES = [
     'ChromeUtils.webidl',
     'Client.webidl',
     'Clients.webidl',
     'ClipboardEvent.webidl',
     'CommandEvent.webidl',
     'Comment.webidl',
     'CompositionEvent.webidl',
     'Console.webidl',
-    'ConstantSourceNode.webidl',
     'Contacts.webidl',
     'ContainerBoxObject.webidl',
     'ConvolverNode.webidl',
     'Coordinates.webidl',
     'CreateOfferRequest.webidl',
     'Crypto.webidl',
     'CSPDictionaries.webidl',
     'CSPReport.webidl',