bug 1179662 uninline DestroyMediaStream overrides so that mStream type need not be complete r=padenot
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 02 Jul 2015 16:44:31 +1200
changeset 251256 950835c3c86f6be445f9709b8d92d71c3af63f8e
parent 251255 8b10b297cec07dfff92e9dce48c630901ca3f581
child 251257 b6672a6212e3a916d3147251d4b06fb30cf35e94
push id28991
push usercbook@mozilla.com
push dateFri, 03 Jul 2015 10:08:14 +0000
treeherdermozilla-central@b6a79816ee71 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1179662
milestone42.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 1179662 uninline DestroyMediaStream overrides so that mStream type need not be complete r=padenot
dom/media/webaudio/AudioBufferSourceNode.cpp
dom/media/webaudio/AudioBufferSourceNode.h
dom/media/webaudio/OscillatorNode.cpp
dom/media/webaudio/OscillatorNode.h
--- a/dom/media/webaudio/AudioBufferSourceNode.cpp
+++ b/dom/media/webaudio/AudioBufferSourceNode.cpp
@@ -563,16 +563,28 @@ AudioBufferSourceNode::AudioBufferSource
   engine->SetSourceStream(static_cast<AudioNodeStream*>(mStream.get()));
   mStream->AddMainThreadListener(this);
 }
 
 AudioBufferSourceNode::~AudioBufferSourceNode()
 {
 }
 
+void
+AudioBufferSourceNode::DestroyMediaStream()
+{
+  if (mStream) {
+    mStream->RemoveMainThreadListener(this);
+  }
+  AudioNode::DestroyMediaStream();
+  if (Context()) {
+    Context()->UnregisterAudioBufferSourceNode(this);
+  }
+}
+
 size_t
 AudioBufferSourceNode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t amount = AudioNode::SizeOfExcludingThis(aMallocSizeOf);
   if (mBuffer) {
     amount += mBuffer->SizeOfIncludingThis(aMallocSizeOf);
   }
 
--- a/dom/media/webaudio/AudioBufferSourceNode.h
+++ b/dom/media/webaudio/AudioBufferSourceNode.h
@@ -16,26 +16,18 @@ namespace dom {
 class AudioParam;
 
 class AudioBufferSourceNode final : public AudioNode,
                                     public MainThreadMediaStreamListener
 {
 public:
   explicit AudioBufferSourceNode(AudioContext* aContext);
 
-  virtual void DestroyMediaStream() override
-  {
-    if (mStream) {
-      mStream->RemoveMainThreadListener(this);
-    }
-    AudioNode::DestroyMediaStream();
-    if (Context()) {
-      Context()->UnregisterAudioBufferSourceNode(this);
-    }
-  }
+  virtual void DestroyMediaStream() override;
+
   virtual uint16_t NumberOfInputs() const final override
   {
     return 0;
   }
   virtual AudioBufferSourceNode* AsAudioBufferSourceNode() override
   {
     return this;
   }
--- a/dom/media/webaudio/OscillatorNode.cpp
+++ b/dom/media/webaudio/OscillatorNode.cpp
@@ -417,16 +417,25 @@ OscillatorNode::SizeOfIncludingThis(Mall
 
 JSObject*
 OscillatorNode::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return OscillatorNodeBinding::Wrap(aCx, this, aGivenProto);
 }
 
 void
+OscillatorNode::DestroyMediaStream()
+{
+  if (mStream) {
+    mStream->RemoveMainThreadListener(this);
+  }
+  AudioNode::DestroyMediaStream();
+}
+
+void
 OscillatorNode::SendFrequencyToStream(AudioNode* aNode)
 {
   OscillatorNode* This = static_cast<OscillatorNode*>(aNode);
   if (!This->mStream) {
     return;
   }
   SendTimelineParameterToStream(This, OscillatorNodeEngine::FREQUENCY, *This->mFrequency);
 }
--- a/dom/media/webaudio/OscillatorNode.h
+++ b/dom/media/webaudio/OscillatorNode.h
@@ -24,23 +24,18 @@ class OscillatorNode final : public Audi
 public:
   explicit OscillatorNode(AudioContext* aContext);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(OscillatorNode, AudioNode)
 
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
-  virtual void DestroyMediaStream() override
-  {
-    if (mStream) {
-      mStream->RemoveMainThreadListener(this);
-    }
-    AudioNode::DestroyMediaStream();
-  }
+  virtual void DestroyMediaStream() override;
+
   virtual uint16_t NumberOfInputs() const final override
   {
     return 0;
   }
 
   OscillatorType Type() const
   {
     return mType;