Bug 865407 - Part 2: Change TextTrackList::RemoveTextTrack() to receive a pointer r=rillian
authorRick Eyre <rick.eyre@hotmail.com>
Mon, 21 Oct 2013 07:15:00 -0700
changeset 166652 d75468812ea4506eee534c5bda18225ffab32530
parent 166651 9d7ed37acfe6f2e9797869b3e690cd8f38a01141
child 166653 d3e014a0b5ad0831f1e6ff42e82f7956da77e6d6
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs865407
milestone27.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 865407 - Part 2: Change TextTrackList::RemoveTextTrack() to receive a pointer r=rillian The only code using this is TextTrackManager::RemoveTextTrack() which receives a non-const pointer.
content/html/content/src/TextTrackManager.cpp
content/media/TextTrackList.cpp
content/media/TextTrackList.h
--- a/content/html/content/src/TextTrackManager.cpp
+++ b/content/html/content/src/TextTrackManager.cpp
@@ -44,17 +44,17 @@ void
 TextTrackManager::AddTextTrack(TextTrack* aTextTrack)
 {
   mTextTracks->AddTextTrack(aTextTrack);
 }
 
 void
 TextTrackManager::RemoveTextTrack(TextTrack* aTextTrack)
 {
-  mTextTracks->RemoveTextTrack(*aTextTrack);
+  mTextTracks->RemoveTextTrack(aTextTrack);
 }
 
 void
 TextTrackManager::DidSeek()
 {
   mTextTracks->DidSeek();
 }
 
--- a/content/media/TextTrackList.cpp
+++ b/content/media/TextTrackList.cpp
@@ -72,20 +72,20 @@ TextTrackList::GetTrackById(const nsAStr
     if (aId.Equals(id)) {
       return mTextTracks[i];
     }
   }
   return nullptr;
 }
 
 void
-TextTrackList::RemoveTextTrack(TextTrack& aTrack)
+TextTrackList::RemoveTextTrack(TextTrack* aTrack)
 {
-  if (mTextTracks.RemoveElement(&aTrack)) {
-    CreateAndDispatchTrackEventRunner(&aTrack, NS_LITERAL_STRING("removetrack"));
+  if (mTextTracks.RemoveElement(aTrack)) {
+    CreateAndDispatchTrackEventRunner(aTrack, NS_LITERAL_STRING("removetrack"));
   }
 }
 
 void
 TextTrackList::DidSeek()
 {
   for (uint32_t i = 0; i < mTextTracks.Length(); i++) {
     mTextTracks[i]->SetDirty();
--- a/content/media/TextTrackList.h
+++ b/content/media/TextTrackList.h
@@ -48,17 +48,17 @@ public:
                                            const nsAString& aLabel,
                                            const nsAString& aLanguage);
   TextTrack* GetTrackById(const nsAString& aId);
 
   void AddTextTrack(TextTrack* aTextTrack) {
     mTextTracks.AppendElement(aTextTrack);
   }
 
-  void RemoveTextTrack(TextTrack& aTrack);
+  void RemoveTextTrack(TextTrack* aTrack);
   void DidSeek();
 
   nsresult DispatchTrackEvent(TrackEvent* aEvent);
 
   IMPL_EVENT_HANDLER(addtrack)
   IMPL_EVENT_HANDLER(removetrack)
 
 private: