Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Issue 944823003: Update a cue's insertion order when reinserting it with addCue() (Closed)

Created:
5 years, 10 months ago by fs
Modified:
5 years, 10 months ago
Reviewers:
philipj_slow
CC:
blink-reviews, nessy, gasubic, eric.carlson_apple.com, feature-media-reviews_chromium.org, dglazkov+blink, blink-reviews-html_chromium.org, vcarbune.chromium
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Update a cue's insertion order when reinserting it with addCue() TextTrack.addCue is specified to always remove the cue from any list it currently resides in, but the implementation would only do that if it was currently in a different track's list. Also update spec. prose snippets and merge the two exception-conditions in the removeCue-implementation. The "!m_cues || !m_cues->remove(cue)" part should never be true unless state has been corrupted, and the spec. only says to throw NotFoundError in any case. BUG=460476 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=190655

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -14 lines) Patch
M LayoutTests/media/track/opera/interfaces/TextTrack/addCue.html View 1 chunk +15 lines, -0 lines 0 comments Download
M Source/core/html/track/TextTrack.cpp View 2 chunks +10 lines, -14 lines 2 comments Download

Messages

Total messages: 9 (2 generated)
fs
5 years, 10 months ago (2015-02-20 16:24:51 UTC) #2
philipj_slow
lgtm The assert can be a follow up if it should hold at all. https://codereview.chromium.org/944823003/diff/1/Source/core/html/track/TextTrack.cpp ...
5 years, 10 months ago (2015-02-23 13:32:13 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/944823003/1
5 years, 10 months ago (2015-02-23 13:32:29 UTC) #5
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://src.chromium.org/viewvc/blink?view=rev&revision=190655
5 years, 10 months ago (2015-02-23 13:34:51 UTC) #6
fs
https://codereview.chromium.org/944823003/diff/1/Source/core/html/track/TextTrack.cpp File Source/core/html/track/TextTrack.cpp (left): https://codereview.chromium.org/944823003/diff/1/Source/core/html/track/TextTrack.cpp#oldcode272 Source/core/html/track/TextTrack.cpp:272: if (!m_cues || !m_cues->remove(cue)) { On 2015/02/23 13:32:13, philipj_UTC7 ...
5 years, 10 months ago (2015-02-23 14:04:49 UTC) #7
fs
On 2015/02/23 14:04:49, fs wrote: > https://codereview.chromium.org/944823003/diff/1/Source/core/html/track/TextTrack.cpp > File Source/core/html/track/TextTrack.cpp (left): > > https://codereview.chromium.org/944823003/diff/1/Source/core/html/track/TextTrack.cpp#oldcode272 > ...
5 years, 10 months ago (2015-02-23 14:05:03 UTC) #8
philipj_slow
5 years, 10 months ago (2015-02-23 14:59:47 UTC) #9
Message was sent while issue was closed.
On 2015/02/23 14:04:49, fs wrote:
>
https://codereview.chromium.org/944823003/diff/1/Source/core/html/track/TextT...
> File Source/core/html/track/TextTrack.cpp (left):
> 
>
https://codereview.chromium.org/944823003/diff/1/Source/core/html/track/TextT...
> Source/core/html/track/TextTrack.cpp:272: if (!m_cues || !m_cues->remove(cue))
{
> On 2015/02/23 13:32:13, philipj_UTC7 wrote:
> > If this shouldn't be possible, can we assert it instead?
> 
> Yes. There're a few of these invariants - in this case it's:
> 
> cue->track() != 0 => track.cues.contains(cue) which in turn implies
> TextTrack::m_cues != 0.
> 
> This is not the only place where we're being "cautious" though. I'm trying to
> clean these up as I go, but I'm sort of aiming at getting the code to a shape
> where it's reasonably easy to verify the invariants to being with.

Sounds like a bright future ahead :)

Powered by Google App Engine
This is Rietveld 408576698