Bug 923301 - Remove now-unnecessary node-type templating of PlayingRefChangeHandler. r=roc, a=lsblakk
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 25 Oct 2013 12:12:12 +1300
changeset 161880 3955e034eda3f07c5b69b51d52efb3c36f8478bc
parent 161879 c351f02b3b3e6130f84b3089d3424a463aab1af7
child 161881 21afec9163f2022e773d510ce7c581ac68c3829e
push id407
push userlsblakk@mozilla.com
push dateTue, 03 Dec 2013 03:32:50 +0000
treeherdermozilla-release@babf8c9ebc52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, lsblakk
bugs923301
milestone26.0
Bug 923301 - Remove now-unnecessary node-type templating of PlayingRefChangeHandler. r=roc, a=lsblakk
content/media/webaudio/ConvolverNode.cpp
content/media/webaudio/ConvolverNode.h
content/media/webaudio/DelayNode.cpp
content/media/webaudio/DelayNode.h
content/media/webaudio/PlayingRefChangeHandler.h
--- a/content/media/webaudio/ConvolverNode.cpp
+++ b/content/media/webaudio/ConvolverNode.cpp
@@ -19,17 +19,17 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED_1(Con
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ConvolverNode)
 NS_INTERFACE_MAP_END_INHERITING(AudioNode)
 
 NS_IMPL_ADDREF_INHERITED(ConvolverNode, AudioNode)
 NS_IMPL_RELEASE_INHERITED(ConvolverNode, AudioNode)
 
 class ConvolverNodeEngine : public AudioNodeEngine
 {
-  typedef PlayingRefChangeHandler<ConvolverNode> PlayingRefChanged;
+  typedef PlayingRefChangeHandler PlayingRefChanged;
 public:
   ConvolverNodeEngine(AudioNode* aNode, bool aNormalize)
     : AudioNodeEngine(aNode)
     , mBufferLength(0)
     , mLeftOverData(INT32_MIN)
     , mSampleRate(0.0f)
     , mUseBackgroundThreads(!aNode->Context()->IsOffline())
     , mNormalize(aNormalize)
--- a/content/media/webaudio/ConvolverNode.h
+++ b/content/media/webaudio/ConvolverNode.h
@@ -8,18 +8,16 @@
 #define ConvolverNode_h_
 
 #include "AudioNode.h"
 #include "AudioBuffer.h"
 
 namespace mozilla {
 namespace dom {
 
-template <class T> class PlayingRefChangeHandler;
-
 class ConvolverNode : public AudioNode
 {
 public:
   explicit ConvolverNode(AudioContext* aContext);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ConvolverNode, AudioNode);
 
--- a/content/media/webaudio/DelayNode.cpp
+++ b/content/media/webaudio/DelayNode.cpp
@@ -22,17 +22,17 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED_1(Del
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DelayNode)
 NS_INTERFACE_MAP_END_INHERITING(AudioNode)
 
 NS_IMPL_ADDREF_INHERITED(DelayNode, AudioNode)
 NS_IMPL_RELEASE_INHERITED(DelayNode, AudioNode)
 
 class DelayNodeEngine : public AudioNodeEngine
 {
-  typedef PlayingRefChangeHandler<DelayNode> PlayingRefChanged;
+  typedef PlayingRefChangeHandler PlayingRefChanged;
 public:
   DelayNodeEngine(AudioNode* aNode, AudioDestinationNode* aDestination,
                   int aMaxDelayFrames)
     : AudioNodeEngine(aNode)
     , mSource(nullptr)
     , mDestination(static_cast<AudioNodeStream*> (aDestination->Stream()))
     // Keep the default value in sync with the default value in DelayNode::DelayNode.
     , mDelay(0.f)
--- a/content/media/webaudio/DelayNode.h
+++ b/content/media/webaudio/DelayNode.h
@@ -9,17 +9,16 @@
 
 #include "AudioNode.h"
 #include "AudioParam.h"
 
 namespace mozilla {
 namespace dom {
 
 class AudioContext;
-template <class T> class PlayingRefChangeHandler;
 
 class DelayNode : public AudioNode
 {
 public:
   DelayNode(AudioContext* aContext, double aMaxDelay);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DelayNode, AudioNode)
--- a/content/media/webaudio/PlayingRefChangeHandler.h
+++ b/content/media/webaudio/PlayingRefChangeHandler.h
@@ -8,37 +8,36 @@
 #define PlayingRefChangeHandler_h__
 
 #include "nsThreadUtils.h"
 #include "AudioNodeStream.h"
 
 namespace mozilla {
 namespace dom {
 
-template<class NodeType>
 class PlayingRefChangeHandler : public nsRunnable
 {
 public:
   enum ChangeType { ADDREF, RELEASE };
   PlayingRefChangeHandler(AudioNodeStream* aStream, ChangeType aChange)
     : mStream(aStream)
     , mChange(aChange)
   {
   }
 
   NS_IMETHOD Run()
   {
-    nsRefPtr<NodeType> node;
+    nsRefPtr<AudioNode> node;
     {
       // No need to keep holding the lock for the whole duration of this
       // function, since we're holding a strong reference to it, so if
       // we can obtain the reference, we will hold the node alive in
       // this function.
       MutexAutoLock lock(mStream->Engine()->NodeMutex());
-      node = static_cast<NodeType*>(mStream->Engine()->Node());
+      node = mStream->Engine()->Node();
     }
     if (node) {
       if (mChange == ADDREF) {
         node->MarkActive();
       } else if (mChange == RELEASE) {
         node->MarkInactive();
       }
     }