Backed out changeset d70b97db8d9e (bug 1324568)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 20 Dec 2016 23:02:48 +0100
changeset 373959 4ee212f486d788dc8343605f9e364b654834854b
parent 373958 faf170d0bdba2f09f6b5875099a930109591fd14
child 373960 9a3a17725724d71bd5906d44018da99e42e9cad8
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1324568
milestone53.0a1
backs outd70b97db8d9e50e3b698f4fd76a5bf995b9ddb4a
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 d70b97db8d9e (bug 1324568)
dom/media/webaudio/AudioBufferSourceNode.cpp
dom/media/webaudio/AudioBufferSourceNode.h
dom/media/webaudio/AudioScheduledSourceNode.cpp
dom/media/webaudio/AudioScheduledSourceNode.h
dom/media/webaudio/ConstantSourceNode.cpp
dom/media/webaudio/ConstantSourceNode.h
dom/media/webaudio/OscillatorNode.cpp
dom/media/webaudio/OscillatorNode.h
dom/media/webaudio/moz.build
dom/webidl/AudioBufferSourceNode.webidl
dom/webidl/AudioScheduledSourceNode.webidl
dom/webidl/ConstantSourceNode.webidl
dom/webidl/OscillatorNode.webidl
dom/webidl/moz.build
--- a/dom/media/webaudio/AudioBufferSourceNode.cpp
+++ b/dom/media/webaudio/AudioBufferSourceNode.cpp
@@ -17,25 +17,23 @@
 #include "AudioDestinationNode.h"
 #include "AudioParamTimeline.h"
 #include <limits>
 #include <algorithm>
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED(AudioBufferSourceNode,
-                                   AudioScheduledSourceNode, mBuffer,
-                                   mPlaybackRate, mDetune)
+NS_IMPL_CYCLE_COLLECTION_INHERITED(AudioBufferSourceNode, AudioNode, mBuffer, mPlaybackRate, mDetune)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(AudioBufferSourceNode)
-NS_INTERFACE_MAP_END_INHERITING(AudioScheduledSourceNode)
+NS_INTERFACE_MAP_END_INHERITING(AudioNode)
 
-NS_IMPL_ADDREF_INHERITED(AudioBufferSourceNode, AudioScheduledSourceNode)
-NS_IMPL_RELEASE_INHERITED(AudioBufferSourceNode, AudioScheduledSourceNode)
+NS_IMPL_ADDREF_INHERITED(AudioBufferSourceNode, AudioNode)
+NS_IMPL_RELEASE_INHERITED(AudioBufferSourceNode, AudioNode)
 
 /**
  * Media-thread playback engine for AudioBufferSourceNode.
  * Nothing is played until a non-null buffer has been set (via
  * AudioNodeStream::SetBuffer) and a non-zero mBufferEnd has been set (via
  * AudioNodeStream::SetInt32Parameter).
  */
 class AudioBufferSourceNodeEngine final : public AudioNodeEngine
@@ -585,20 +583,20 @@ public:
   AudioNodeStream* mDestination;
   AudioNodeStream* mSource;
   AudioParamTimeline mPlaybackRateTimeline;
   AudioParamTimeline mDetuneTimeline;
   bool mLoop;
 };
 
 AudioBufferSourceNode::AudioBufferSourceNode(AudioContext* aContext)
-  : AudioScheduledSourceNode(aContext,
-                             2,
-                             ChannelCountMode::Max,
-                             ChannelInterpretation::Speakers)
+  : AudioNode(aContext,
+              2,
+              ChannelCountMode::Max,
+              ChannelInterpretation::Speakers)
   , mLoopStart(0.0)
   , mLoopEnd(0.0)
   // mOffset and mDuration are initialized in Start().
   , mPlaybackRate(new AudioParam(this, PLAYBACKRATE, 1.0f, "playbackRate"))
   , mDetune(new AudioParam(this, DETUNE, 0.0f, "detune"))
   , mLoop(false)
   , mStartCalled(false)
 {
@@ -709,22 +707,16 @@ AudioBufferSourceNode::Start(double aWhe
 
   // Don't set parameter unnecessarily
   if (aWhen > 0.0) {
     ns->SetDoubleParameter(START, aWhen);
   }
 }
 
 void
-AudioBufferSourceNode::Start(double aWhen, ErrorResult& aRv)
-{
-  Start(aWhen, 0 /* offset */, Optional<double>(), aRv);
-}
-
-void
 AudioBufferSourceNode::SendBufferParameterToStream(JSContext* aCx)
 {
   AudioNodeStream* ns = mStream;
   if (!ns) {
     return;
   }
 
   if (mBuffer) {
--- a/dom/media/webaudio/AudioBufferSourceNode.h
+++ b/dom/media/webaudio/AudioBufferSourceNode.h
@@ -2,26 +2,26 @@
 /* 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 AudioBufferSourceNode_h_
 #define AudioBufferSourceNode_h_
 
-#include "AudioScheduledSourceNode.h"
+#include "AudioNode.h"
 #include "AudioBuffer.h"
 
 namespace mozilla {
 namespace dom {
 
 struct AudioBufferSourceOptions;
 class AudioParam;
 
-class AudioBufferSourceNode final : public AudioScheduledSourceNode
+class AudioBufferSourceNode final : public AudioNode
                                   , public MainThreadMediaStreamListener
 {
 public:
   static already_AddRefed<AudioBufferSourceNode>
   Create(JSContext* aCx, AudioContext& aAudioContext,
          const AudioBufferSourceOptions& aOptions, ErrorResult& aRv);
 
   void DestroyMediaStream() override;
@@ -30,33 +30,30 @@ public:
   {
     return 0;
   }
   AudioBufferSourceNode* AsAudioBufferSourceNode() override
   {
     return this;
   }
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioBufferSourceNode,
-                                           AudioScheduledSourceNode)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioBufferSourceNode, AudioNode)
 
   static already_AddRefed<AudioBufferSourceNode>
   Constructor(const GlobalObject& aGlobal, AudioContext& aAudioContext,
               const AudioBufferSourceOptions& aOptions, ErrorResult& aRv)
   {
     return Create(aGlobal.Context(), aAudioContext, aOptions, aRv);
   }
 
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
   void Start(double aWhen, double aOffset,
              const Optional<double>& aDuration, ErrorResult& aRv);
-
-  void Start(double aWhen, ErrorResult& aRv) override;
-  void Stop(double aWhen, ErrorResult& aRv) override;
+  void Stop(double aWhen, ErrorResult& aRv);
 
   AudioBuffer* GetBuffer(JSContext* aCx) const
   {
     return mBuffer;
   }
   void SetBuffer(JSContext* aCx, AudioBuffer* aBuffer)
   {
     mBuffer = aBuffer;
@@ -95,16 +92,18 @@ public:
   }
   void SetLoopEnd(double aEnd)
   {
     mLoopEnd = aEnd;
     SendLoopParametersToStream();
   }
   void SendDopplerShiftToStream(double aDopplerShift);
 
+  IMPL_EVENT_HANDLER(ended)
+
   void NotifyMainThreadStreamFinished() override;
 
   const char* NodeType() const override
   {
     return "AudioBufferSourceNode";
   }
 
   size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;
deleted file mode 100644
--- a/dom/media/webaudio/AudioScheduledSourceNode.cpp
+++ /dev/null
@@ -1,29 +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 "AudioScheduledSourceNode.h"
-#include "mozilla/dom/AudioScheduledSourceNodeBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-AudioScheduledSourceNode::AudioScheduledSourceNode(AudioContext* aContext,
-                                                   uint32_t aChannelCount,
-                                                   ChannelCountMode aChannelCountMode,
-                                                   ChannelInterpretation aChannelInterpretation)
-  : AudioNode(aContext, aChannelCount, aChannelCountMode,
-              aChannelInterpretation)
-{}
-
-JSObject*
-AudioScheduledSourceNode::WrapObject(JSContext* aCx,
-                                     JS::Handle<JSObject*> aGivenProto)
-{
-  return AudioScheduledSourceNodeBinding::Wrap(aCx, this, aGivenProto);
-}
-
-} // dom namespace
-} // mozilla namespace
deleted file mode 100644
--- a/dom/media/webaudio/AudioScheduledSourceNode.h
+++ /dev/null
@@ -1,40 +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 AudioScheduledSourceNode_h_
-#define AudioScheduledSourceNode_h_
-
-#include "AudioNode.h"
-#include "mozilla/dom/AudioScheduledSourceNodeBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-class AudioContext;
-
-class AudioScheduledSourceNode : public AudioNode
-{
-public:
-  JSObject* WrapObject(JSContext* aCx,
-                       JS::Handle<JSObject*> aGivenProto) override;
-
-  virtual void Start(double aWhen, ErrorResult& aRv) = 0;
-  virtual void Stop(double aWhen, ErrorResult& aRv) = 0;
-
-  IMPL_EVENT_HANDLER(ended)
-
-protected:
-  AudioScheduledSourceNode(AudioContext* aContext,
-                           uint32_t aChannelCount,
-                           ChannelCountMode aChannelCountMode,
-                           ChannelInterpretation aChannelInterpretation);
-  virtual ~AudioScheduledSourceNode() = default;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif
--- a/dom/media/webaudio/ConstantSourceNode.cpp
+++ b/dom/media/webaudio/ConstantSourceNode.cpp
@@ -7,24 +7,24 @@
 #include "ConstantSourceNode.h"
 
 #include "AudioDestinationNode.h"
 #include "nsContentUtils.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED(ConstantSourceNode, AudioScheduledSourceNode,
+NS_IMPL_CYCLE_COLLECTION_INHERITED(ConstantSourceNode, AudioNode,
                                    mOffset)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ConstantSourceNode)
-NS_INTERFACE_MAP_END_INHERITING(AudioScheduledSourceNode)
+NS_INTERFACE_MAP_END_INHERITING(AudioNode)
 
-NS_IMPL_ADDREF_INHERITED(ConstantSourceNode, AudioScheduledSourceNode)
-NS_IMPL_RELEASE_INHERITED(ConstantSourceNode, AudioScheduledSourceNode)
+NS_IMPL_ADDREF_INHERITED(ConstantSourceNode, AudioNode)
+NS_IMPL_RELEASE_INHERITED(ConstantSourceNode, AudioNode)
 
 class ConstantSourceNodeEngine final : public AudioNodeEngine
 {
 public:
   ConstantSourceNodeEngine(AudioNode* aNode, AudioDestinationNode* aDestination)
     : AudioNodeEngine(aNode)
     , mSource(nullptr)
     , mDestination(aDestination->Stream())
@@ -137,20 +137,20 @@ public:
   AudioNodeStream* mSource;
   AudioNodeStream* mDestination;
   StreamTime mStart;
   StreamTime mStop;
   AudioParamTimeline mOffset;
 };
 
 ConstantSourceNode::ConstantSourceNode(AudioContext* aContext)
-  : AudioScheduledSourceNode(aContext,
-                             1,
-                             ChannelCountMode::Max,
-                             ChannelInterpretation::Speakers)
+  : AudioNode(aContext,
+              1,
+              ChannelCountMode::Max,
+              ChannelInterpretation::Speakers)
   , mOffset(new AudioParam(this, ConstantSourceNodeEngine::OFFSET,
                            1.0, "offset"))
   , mStartCalled(false)
 {
   ConstantSourceNodeEngine* engine = new ConstantSourceNodeEngine(this, aContext->Destination());
   mStream = AudioNodeStream::Create(aContext, engine,
                                     AudioNodeStream::NEED_MAIN_THREAD_FINISHED,
                                     aContext->Graph());
--- a/dom/media/webaudio/ConstantSourceNode.h
+++ b/dom/media/webaudio/ConstantSourceNode.h
@@ -2,33 +2,33 @@
 /* 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 "AudioScheduledSourceNode.h"
+#include "AudioNode.h"
 #include "AudioParam.h"
 #include "mozilla/dom/ConstantSourceNodeBinding.h"
 
 namespace mozilla {
 namespace dom {
 
 class AudioContext;
 
-class ConstantSourceNode final : public AudioScheduledSourceNode
-                               , public MainThreadMediaStreamListener
+class ConstantSourceNode final : public AudioNode,
+                                 public MainThreadMediaStreamListener
 {
 public:
   explicit ConstantSourceNode(AudioContext* aContext);
 
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ConstantSourceNode, AudioScheduledSourceNode)
+  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,
               AudioContext& aContext,
               const ConstantSourceOptions& aOptions,
               ErrorResult& aRv);
@@ -40,18 +40,20 @@ public:
     return 0;
   }
 
   AudioParam* Offset() const
   {
     return mOffset;
   }
 
-  void Start(double aWhen, ErrorResult& rv) override;
-  void Stop(double aWhen, ErrorResult& rv) override;
+  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";
   }
 
--- a/dom/media/webaudio/OscillatorNode.cpp
+++ b/dom/media/webaudio/OscillatorNode.cpp
@@ -10,24 +10,24 @@
 #include "AudioDestinationNode.h"
 #include "nsContentUtils.h"
 #include "WebAudioUtils.h"
 #include "blink/PeriodicWave.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED(OscillatorNode, AudioScheduledSourceNode,
+NS_IMPL_CYCLE_COLLECTION_INHERITED(OscillatorNode, AudioNode,
                                    mPeriodicWave, mFrequency, mDetune)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(OscillatorNode)
-NS_INTERFACE_MAP_END_INHERITING(AudioScheduledSourceNode)
+NS_INTERFACE_MAP_END_INHERITING(AudioNode)
 
-NS_IMPL_ADDREF_INHERITED(OscillatorNode, AudioScheduledSourceNode)
-NS_IMPL_RELEASE_INHERITED(OscillatorNode, AudioScheduledSourceNode)
+NS_IMPL_ADDREF_INHERITED(OscillatorNode, AudioNode)
+NS_IMPL_RELEASE_INHERITED(OscillatorNode, AudioNode)
 
 class OscillatorNodeEngine final : public AudioNodeEngine
 {
 public:
   OscillatorNodeEngine(AudioNode* aNode, AudioDestinationNode* aDestination)
     : AudioNodeEngine(aNode)
     , mSource(nullptr)
     , mDestination(aDestination->Stream())
@@ -403,20 +403,20 @@ public:
   RefPtr<ThreadSharedFloatArrayBufferList> mCustom;
   RefPtr<BasicWaveFormCache> mBasicWaveFormCache;
   uint32_t mCustomLength;
   bool mCustomDisableNormalization;
   RefPtr<WebCore::PeriodicWave> mPeriodicWave;
 };
 
 OscillatorNode::OscillatorNode(AudioContext* aContext)
-  : AudioScheduledSourceNode(aContext,
-                             2,
-                             ChannelCountMode::Max,
-                             ChannelInterpretation::Speakers)
+  : AudioNode(aContext,
+              2,
+              ChannelCountMode::Max,
+              ChannelInterpretation::Speakers)
   , mType(OscillatorType::Sine)
   , mFrequency(new AudioParam(this, OscillatorNodeEngine::FREQUENCY,
                               440.0f, "frequency"))
   , mDetune(new AudioParam(this, OscillatorNodeEngine::DETUNE, 0.0f, "detune"))
   , mStartCalled(false)
 {
   OscillatorNodeEngine* engine = new OscillatorNodeEngine(this, aContext->Destination());
   mStream = AudioNodeStream::Create(aContext, engine,
--- a/dom/media/webaudio/OscillatorNode.h
+++ b/dom/media/webaudio/OscillatorNode.h
@@ -2,37 +2,37 @@
 /* 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 OscillatorNode_h_
 #define OscillatorNode_h_
 
-#include "AudioScheduledSourceNode.h"
+#include "AudioNode.h"
 #include "AudioParam.h"
 #include "PeriodicWave.h"
 #include "mozilla/dom/OscillatorNodeBinding.h"
 
 namespace mozilla {
 namespace dom {
 
 class AudioContext;
 struct OscillatorOptions;
 
-class OscillatorNode final : public AudioScheduledSourceNode
-                           , public MainThreadMediaStreamListener
+class OscillatorNode final : public AudioNode,
+                             public MainThreadMediaStreamListener
 {
 public:
   static already_AddRefed<OscillatorNode>
   Create(AudioContext& aAudioContext, const OscillatorOptions& aOptions,
          ErrorResult& aRv);
 
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(OscillatorNode, AudioScheduledSourceNode)
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(OscillatorNode, AudioNode)
 
   static already_AddRefed<OscillatorNode>
   Constructor(const GlobalObject& aGlobal, AudioContext& aAudioContext,
               const OscillatorOptions& aOptions, ErrorResult& aRv)
   {
     return Create(aAudioContext, aOptions, aRv);
   }
 
@@ -65,27 +65,28 @@ public:
   {
     return mFrequency;
   }
   AudioParam* Detune() const
   {
     return mDetune;
   }
 
-  void Start(double aWhen, ErrorResult& aRv) override;
-  void Stop(double aWhen, ErrorResult& aRv) override;
-
+  void Start(double aWhen, ErrorResult& aRv);
+  void Stop(double aWhen, ErrorResult& aRv);
   void SetPeriodicWave(PeriodicWave& aPeriodicWave)
   {
     mPeriodicWave = &aPeriodicWave;
     // SendTypeToStream will call SendPeriodicWaveToStream for us.
     mType = OscillatorType::Custom;
     SendTypeToStream();
   }
 
+  IMPL_EVENT_HANDLER(ended)
+
   void NotifyMainThreadStreamFinished() override;
 
   const char* NodeType() const override
   {
     return "OscillatorNode";
   }
 
   size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;
--- a/dom/media/webaudio/moz.build
+++ b/dom/media/webaudio/moz.build
@@ -49,17 +49,16 @@ EXPORTS.mozilla.dom += [
     'AudioBuffer.h',
     'AudioBufferSourceNode.h',
     'AudioContext.h',
     'AudioDestinationNode.h',
     'AudioListener.h',
     'AudioNode.h',
     'AudioParam.h',
     'AudioProcessingEvent.h',
-    'AudioScheduledSourceNode.h',
     'BiquadFilterNode.h',
     'ChannelMergerNode.h',
     'ChannelSplitterNode.h',
     'ConstantSourceNode.h',
     'ConvolverNode.h',
     'DelayNode.h',
     'DynamicsCompressorNode.h',
     'GainNode.h',
@@ -85,17 +84,16 @@ UNIFIED_SOURCES += [
     'AudioEventTimeline.cpp',
     'AudioListener.cpp',
     'AudioNode.cpp',
     'AudioNodeEngine.cpp',
     'AudioNodeExternalInputStream.cpp',
     'AudioNodeStream.cpp',
     'AudioParam.cpp',
     'AudioProcessingEvent.cpp',
-    'AudioScheduledSourceNode.cpp',
     'BiquadFilterNode.cpp',
     'BufferDecoder.cpp',
     'ChannelMergerNode.cpp',
     'ChannelSplitterNode.cpp',
     'ConstantSourceNode.cpp',
     'ConvolverNode.cpp',
     'DelayBuffer.cpp',
     'DelayNode.cpp',
--- a/dom/webidl/AudioBufferSourceNode.webidl
+++ b/dom/webidl/AudioBufferSourceNode.webidl
@@ -16,26 +16,30 @@ dictionary AudioBufferSourceOptions {
              boolean      loop = false;
              double       loopEnd = 0;
              double       loopStart = 0;
              float        playbackRate = 1;
 };
 
 [Pref="dom.webaudio.enabled",
  Constructor(BaseAudioContext context, optional AudioBufferSourceOptions options)]
-interface AudioBufferSourceNode : AudioScheduledSourceNode {
+interface AudioBufferSourceNode : AudioNode {
 
     attribute AudioBuffer? buffer;
 
     readonly attribute AudioParam playbackRate;
     readonly attribute AudioParam detune;
 
     attribute boolean loop;
     attribute double loopStart;
     attribute double loopEnd;
 
     [Throws, UnsafeInPrerendering]
     void start(optional double when = 0, optional double grainOffset = 0,
                optional double grainDuration);
+    [Throws, UnsafeInPrerendering]
+    void stop(optional double when = 0);
+
+    attribute EventHandler onended;
 };
 
 // Mozilla extensions
 AudioBufferSourceNode implements AudioNodePassThrough;
deleted file mode 100644
--- a/dom/webidl/AudioScheduledSourceNode.webidl
+++ /dev/null
@@ -1,20 +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/#idl-def-AudioScheduledSourceNode
- *
- * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
- * liability, trademark and document use rules apply.
- */
-
-interface AudioScheduledSourceNode : AudioNode {
-                    attribute EventHandler onended;
-    [Throws, UnsafeInPrerendering]
-    void start (optional double when = 0);
-
-    [Throws, UnsafeInPrerendering]
-    void stop (optional double when = 0);
-};
--- a/dom/webidl/ConstantSourceNode.webidl
+++ b/dom/webidl/ConstantSourceNode.webidl
@@ -11,11 +11,16 @@
  */
 
 dictionary ConstantSourceOptions {
     float offset = 1;
 };
 
 [Pref="dom.webaudio.enabled",
  Constructor(BaseAudioContext context, optional ConstantSourceOptions options)]
-interface ConstantSourceNode :  AudioScheduledSourceNode {
+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/OscillatorNode.webidl
+++ b/dom/webidl/OscillatorNode.webidl
@@ -22,21 +22,28 @@ dictionary OscillatorOptions : AudioNode
              OscillatorType type = "sine";
              float          frequency = 440;
              float          detune = 0;
              PeriodicWave   periodicWave;
 };
 
 [Pref="dom.webaudio.enabled",
  Constructor(BaseAudioContext context, optional OscillatorOptions options)]
-interface OscillatorNode : AudioScheduledSourceNode {
+interface OscillatorNode : AudioNode {
 
     [SetterThrows]
     attribute OscillatorType type;
 
     readonly attribute AudioParam frequency; // in Hertz
     readonly attribute AudioParam detune; // in Cents
 
+    [Throws, UnsafeInPrerendering]
+    void start(optional double when = 0);
+    [Throws, UnsafeInPrerendering]
+    void stop(optional double when = 0);
     void setPeriodicWave(PeriodicWave periodicWave);
+
+    attribute EventHandler onended;
+
 };
 
 // Mozilla extensions
 OscillatorNode implements AudioNodePassThrough;
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -36,17 +36,16 @@ WEBIDL_FILES = [
     'AudioBufferSourceNode.webidl',
     'AudioChannel.webidl',
     'AudioContext.webidl',
     'AudioDestinationNode.webidl',
     'AudioListener.webidl',
     'AudioNode.webidl',
     'AudioParam.webidl',
     'AudioProcessingEvent.webidl',
-    'AudioScheduledSourceNode.webidl',
     'AudioStreamTrack.webidl',
     'AudioTrack.webidl',
     'AudioTrackList.webidl',
     'AudioWorkletGlobalScope.webidl',
     'AutocompleteInfo.webidl',
     'BarProp.webidl',
     'BaseAudioContext.webidl',
     'BaseKeyframeTypes.webidl',