Bug 1025324 - Define an out of line destructor for MediaSource so that we can forward delcare MediaSourceList in MediaSource.h; r=bzbarsky
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 14 Jun 2014 10:04:01 -0400
changeset 188758 4a4e2e4c8440c4fbf25fe218ac9d40390fc65c02
parent 188757 94527ff59216ac615edda3b955980618b2c3edea
child 188759 d5a6e235e674eeba12c0d48314233b7985b0d8e2
push id44907
push usereakhgari@mozilla.com
push dateSat, 14 Jun 2014 14:04:09 +0000
treeherdermozilla-inbound@4a4e2e4c8440 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs1025324
milestone33.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 1025324 - Define an out of line destructor for MediaSource so that we can forward delcare MediaSourceList in MediaSource.h; r=bzbarsky This is required because the destructor for the nsRefPtr<MediaSourceList> member requires the full definition of the type.
content/media/mediasource/MediaSource.cpp
content/media/mediasource/MediaSource.h
--- a/content/media/mediasource/MediaSource.cpp
+++ b/content/media/mediasource/MediaSource.cpp
@@ -101,16 +101,20 @@ MediaSource::Constructor(const GlobalObj
     aRv.Throw(NS_ERROR_UNEXPECTED);
     return nullptr;
   }
 
   nsRefPtr<MediaSource> mediaSource = new MediaSource(window);
   return mediaSource.forget();
 }
 
+MediaSource::~MediaSource()
+{
+}
+
 SourceBufferList*
 MediaSource::SourceBuffers()
 {
   MOZ_ASSERT_IF(mReadyState == MediaSourceReadyState::Closed, mSourceBuffers->IsEmpty());
   return mSourceBuffers;
 }
 
 SourceBufferList*
--- a/content/media/mediasource/MediaSource.h
+++ b/content/media/mediasource/MediaSource.h
@@ -45,16 +45,18 @@ template <typename T> class Optional;
 class MediaSource MOZ_FINAL : public DOMEventTargetHelper
 {
 public:
   /** WebIDL Methods. */
   static already_AddRefed<MediaSource>
   Constructor(const GlobalObject& aGlobal,
               ErrorResult& aRv);
 
+  ~MediaSource();
+
   SourceBufferList* SourceBuffers();
   SourceBufferList* ActiveSourceBuffers();
   MediaSourceReadyState ReadyState();
 
   double Duration();
   void SetDuration(double aDuration, ErrorResult& aRv);
 
   already_AddRefed<SourceBuffer> AddSourceBuffer(const nsAString& aType, ErrorResult& aRv);