Bug 1509446 - part4 : remove set dirty. r=jya
authorAlastor Wu <alwu@mozilla.com>
Thu, 07 Mar 2019 19:24:02 +0000
changeset 520965 ad7bfe5bbc3a
parent 520964 d1046aea2e0e
child 520966 057318480b0e
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1509446
milestone67.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 1509446 - part4 : remove set dirty. r=jya As the `active cues list` would be automatically contruct when there are any active cues being added or inactive cues being removed, we have no need to use dirty to reset the `active cues list`. Differential Revision: https://phabricator.services.mozilla.com/D22150
dom/html/TextTrackManager.cpp
dom/media/TextTrack.cpp
dom/media/TextTrackList.cpp
dom/media/TextTrackList.h
--- a/dom/html/TextTrackManager.cpp
+++ b/dom/html/TextTrackManager.cpp
@@ -225,19 +225,16 @@ void TextTrackManager::RemoveTextTrack(T
       mNewCues->RemoveCue(*((*removeCueList)[i]));
     }
     TimeMarchesOn();
   }
 }
 
 void TextTrackManager::DidSeek() {
   WEBVTT_LOG("%p DidSeek", this);
-  if (mTextTracks) {
-    mTextTracks->DidSeek();
-  }
   if (mMediaElement) {
     mLastTimeMarchesOnCalled = mMediaElement->CurrentTime();
     WEBVTT_LOGV("DidSeek set mLastTimeMarchesOnCalled %lf",
                 mLastTimeMarchesOnCalled);
   }
   mHasSeeked = true;
 }
 
--- a/dom/media/TextTrack.cpp
+++ b/dom/media/TextTrack.cpp
@@ -123,34 +123,32 @@ void TextTrack::AddCue(TextTrackCue& aCu
   mCueList->AddCue(aCue);
   aCue.SetTrack(this);
   if (mTextTrackList) {
     HTMLMediaElement* mediaElement = mTextTrackList->GetMediaElement();
     if (mediaElement && (mMode != TextTrackMode::Disabled)) {
       mediaElement->NotifyCueAdded(aCue);
     }
   }
-  SetDirty();
 }
 
 void TextTrack::RemoveCue(TextTrackCue& aCue, ErrorResult& aRv) {
   // Bug1304948, check the aCue belongs to the TextTrack.
   mCueList->RemoveCue(aCue, aRv);
   if (aRv.Failed()) {
     return;
   }
   aCue.SetActive(false);
   aCue.SetTrack(nullptr);
   if (mTextTrackList) {
     HTMLMediaElement* mediaElement = mTextTrackList->GetMediaElement();
     if (mediaElement) {
       mediaElement->NotifyCueRemoved(aCue);
     }
   }
-  SetDirty();
 }
 
 void TextTrack::SetCuesDirty() {
   for (uint32_t i = 0; i < mCueList->Length(); i++) {
     ((*mCueList)[i])->Reset();
   }
 }
 
@@ -207,17 +205,16 @@ void TextTrack::SetCuesInactive() { mCue
 void TextTrack::NotifyCueUpdated(TextTrackCue* aCue) {
   mCueList->NotifyCueUpdated(aCue);
   if (mTextTrackList) {
     HTMLMediaElement* mediaElement = mTextTrackList->GetMediaElement();
     if (mediaElement) {
       mediaElement->NotifyCueUpdated(aCue);
     }
   }
-  SetDirty();
 }
 
 void TextTrack::GetLabel(nsAString& aLabel) const {
   if (mTrackElement) {
     mTrackElement->GetLabel(aLabel);
   } else {
     aLabel = mLabel;
   }
--- a/dom/media/TextTrackList.cpp
+++ b/dom/media/TextTrackList.cpp
@@ -100,22 +100,16 @@ TextTrack* TextTrackList::GetTrackById(c
 }
 
 void TextTrackList::RemoveTextTrack(TextTrack* aTrack) {
   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();
-  }
-}
-
 class TrackEventRunner : public Runnable {
  public:
   TrackEventRunner(TextTrackList* aList, Event* aEvent)
       : Runnable("dom::TrackEventRunner"), mList(aList), mEvent(aEvent) {}
 
   NS_IMETHOD Run() override { return mList->DispatchTrackEvent(mEvent); }
 
   RefPtr<TextTrackList> mList;
--- a/dom/media/TextTrackList.h
+++ b/dom/media/TextTrackList.h
@@ -45,17 +45,16 @@ class TextTrackList final : public DOMEv
       TextTrackKind aKind, const nsAString& aLabel, const nsAString& aLanguage,
       TextTrackMode aMode, TextTrackReadyState aReadyState,
       TextTrackSource aTextTrackSource, const CompareTextTracks& aCompareTT);
   TextTrack* GetTrackById(const nsAString& aId);
 
   void AddTextTrack(TextTrack* aTextTrack, const CompareTextTracks& aCompareTT);
 
   void RemoveTextTrack(TextTrack* aTrack);
-  void DidSeek();
 
   HTMLMediaElement* GetMediaElement();
   void SetTextTrackManager(TextTrackManager* aTextTrackManager);
 
   nsresult DispatchTrackEvent(Event* aEvent);
   void CreateAndDispatchChangeEvent();
   void SetCuesInactive();