Bug 1156689: Part3. Add TrackInfo virtual destructor. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 01 May 2015 15:26:50 +1000
changeset 273338 d2ed413a2048e1529de2ef2be7783c9f10cf3f98
parent 273337 5e07e2b10a788f2527ce6f8e4ac5d920798d4b06
child 273339 4b6149e01e96fc44ada6695359e2a0189f160684
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1156689
milestone40.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 1156689: Part3. Add TrackInfo virtual destructor. r=cpearce So TrackInfo objects can be allocated on the stack.
dom/media/MediaInfo.h
--- a/dom/media/MediaInfo.h
+++ b/dom/media/MediaInfo.h
@@ -37,16 +37,17 @@ public:
     , mLabel(aLabel)
     , mLanguage(aLanguage)
     , mEnabled(aEnabled)
     , mTrackId(aTrackId)
     , mDuration(0)
     , mMediaTime(0)
     , mType(aType)
   {
+    MOZ_COUNT_CTOR(TrackInfo);
   }
 
   // Only used for backward compatibility. Do not use in new code.
   void Init(TrackType aType,
             const nsAString& aId,
             const nsAString& aKind,
             const nsAString& aLabel,
             const nsAString& aLanguage,
@@ -89,16 +90,21 @@ public:
     return mType == kTextTrack;
   }
   TrackType GetType() const
   {
     return mType;
   }
   bool virtual IsValid() const = 0;
 
+  virtual ~TrackInfo()
+  {
+    MOZ_COUNT_DTOR(TrackInfo);
+  }
+
 private:
   TrackType mType;
 };
 
 // Stores info relevant to presenting media frames.
 class VideoInfo : public TrackInfo {
 public:
   VideoInfo()