Bug 1533909 - part2 : add assertion to ensure we should always get a valid TextTrackCueList. r=jya
authorAlastor Wu <alwu@mozilla.com>
Wed, 13 Mar 2019 05:28:44 +0000
changeset 521669 c83f5ecdd6d633b9df3263c83e438bbef1c9a103
parent 521668 440f5cace4fb738b5e22d8fb3f1756341d90b5b8
child 521670 af0f103d341d5c1c2abf30c3670f53be692d0ee2
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1533909
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 1533909 - part2 : add assertion to ensure we should always get a valid TextTrackCueList. r=jya In this comparison, we only process `hidden` or `showing` track which should not return null TextTrackCueList. Differential Revision: https://phabricator.services.mozilla.com/D23087
dom/html/TextTrackManager.cpp
--- a/dom/html/TextTrackManager.cpp
+++ b/dom/html/TextTrackManager.cpp
@@ -529,16 +529,17 @@ class CompareSimpleTextTrackEvents {
       }
       if (c1->EndTime() < c2->EndTime()) {
         return true;
       } else if (c1->EndTime() > c2->EndTime()) {
         return false;
       }
 
       TextTrackCueList* cueList = t1->GetCues();
+      MOZ_ASSERT(cueList);
       nsTArray<RefPtr<TextTrackCue>>& cues = cueList->GetCuesArray();
       auto index1 = cues.IndexOf(c1);
       auto index2 = cues.IndexOf(c2);
       if (index1 < index2) {
         return true;
       } else if (index1 > index2) {
         return false;
       }