Bug 118687

Summary: Make WebVTTParser return cue data instead of cue DOM objects
Product: WebKit Reporter: Brendan Long <b.long>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, eric.carlson, esprehn+autocc, japhet, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2
none
Set id, fix removeCue, and make ChangeLog more detailed
none
Return faster, use ASSERT_UNUSED, and use HashMap pointers none

Brendan Long
Reported 2013-07-15 14:41:11 PDT
Make WebVTTParser return cue data instead of cue DOM objects
Attachments
Patch (15.25 KB, patch)
2013-07-15 14:43 PDT, Brendan Long
no flags
Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2 (521.59 KB, application/zip)
2013-07-16 03:46 PDT, Build Bot
no flags
Set id, fix removeCue, and make ChangeLog more detailed (15.99 KB, patch)
2013-07-16 10:52 PDT, Brendan Long
no flags
Return faster, use ASSERT_UNUSED, and use HashMap pointers (18.84 KB, patch)
2013-07-16 13:12 PDT, Brendan Long
no flags
Brendan Long
Comment 1 2013-07-15 14:43:31 PDT
Brendan Long
Comment 2 2013-07-15 14:44:33 PDT
This would be useful because the GStreamer media player can get WebVTT cues, and then use this same parser: https://bugs.webkit.org/show_bug.cgi?id=103771
Build Bot
Comment 3 2013-07-16 03:46:45 PDT
Comment on attachment 206685 [details] Patch Attachment 206685 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/1087131 New failing tests: http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame.html fullscreen/full-screen-iframe-with-max-width-height.html media/track/opera/interfaces/TextTrackCue/id.html media/track/track-add-remove-cue.html media/track/track-css-matching.html editing/pasteboard/copy-image-with-alt-text.html http/tests/inspector/inspect-element.html
Build Bot
Comment 4 2013-07-16 03:46:46 PDT
Created attachment 206750 [details] Archive of layout-test-results from webkit-ews-13 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-13 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.3
Ryosuke Niwa
Comment 5 2013-07-16 05:22:57 PDT
Comment on attachment 206685 [details] Patch r- since the patch appears to break tests.
Eric Carlson
Comment 6 2013-07-16 09:12:10 PDT
Comment on attachment 206685 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=206685&action=review > Source/WebCore/ChangeLog:15 > + (WebCore::TextTrackCueMap::add): > + (WebCore::TextTrackCueMap::find): > + (WebCore::TextTrackCueMap::remove): > + (WebCore::InbandTextTrack::removeGenericCue): > + (WebCore::InbandTextTrack::addWebVTTCue): I find it much easier to review a patch when the ChangeLog has per-method comments.
Brendan Long
Comment 7 2013-07-16 09:15:55 PDT
(In reply to comment #5) > (From update of attachment 206685 [details]) > r- since the patch appears to break tests. I missed the setId() calls. I'll upload a new version in just a minute (with per-method comments for Eric).
Brendan Long
Comment 8 2013-07-16 10:03:23 PDT
Actually, I think I made a mistake with the removeCue() method. I thought it was only valid for user-created tracks.
Brendan Long
Comment 9 2013-07-16 10:52:57 PDT
Created attachment 206796 [details] Set id, fix removeCue, and make ChangeLog more detailed
Brendan Long
Comment 10 2013-07-16 10:54:00 PDT
This version is a little more complicated to make the removeCue() method work correctly, since it needs to be able to look up both kinds of cues without casting (since we don't know if a cue is a TextTrackCueGeneric until we've found it in the map..).
Eric Carlson
Comment 11 2013-07-16 11:51:45 PDT
Comment on attachment 206796 [details] Set id, fix removeCue, and make ChangeLog more detailed View in context: https://bugs.webkit.org/attachment.cgi?id=206796&action=review > Source/WebCore/html/track/InbandTextTrack.cpp:108 > + m_genericDataToCueMap.remove(genericData); > + m_genericCueToDataMap.remove(cue); Can't you return here and avoid the call to findWebVTTData() (which will fail anyway)? > Source/WebCore/html/track/InbandTextTrack.cpp:316 > + UNUSED_PARAM(trackPrivate); > + ASSERT(trackPrivate == m_private); I think you can use "ASSERT_UNUSED(trackPrivate, trackPrivate == m_private)" here. > Source/WebCore/html/track/InbandTextTrack.h:69 > + GenericCueToCueDataMap m_genericCueToDataMap; > + GenericCueDataToCueMap m_genericDataToCueMap; > + CueToWebVTTCueDataMap m_webVTTCueToDataMap; > + WebVTTCueDataToCueMap m_webVTTDataToCueMap; A track will never have more than one type of cue so we will only ever use two of these. Can they be explicitly allocated?
Brendan Long
Comment 12 2013-07-16 12:46:21 PDT
(In reply to comment #11) > (From update of attachment 206796 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=206796&action=review > > > Source/WebCore/html/track/InbandTextTrack.cpp:108 > > + m_genericDataToCueMap.remove(genericData); > > + m_genericCueToDataMap.remove(cue); > > Can't you return here and avoid the call to findWebVTTData() (which will fail anyway)? That makes sense. > > Source/WebCore/html/track/InbandTextTrack.cpp:316 > > + UNUSED_PARAM(trackPrivate); > > + ASSERT(trackPrivate == m_private); > > I think you can use "ASSERT_UNUSED(trackPrivate, trackPrivate == m_private)" here. Cool, I didn't know about that macro. > A track will never have more than one type of cue so we will only ever use two of these. Can they be explicitly allocated? How? I tried making it a RefPtr<HashMap<...> >, but HashMap doesn't implement RefCounted.
Brendan Long
Comment 13 2013-07-16 12:47:02 PDT
(In reply to comment #12) > > A track will never have more than one type of cue so we will only ever use two of these. Can they be explicitly allocated? > > How? I tried making it a RefPtr<HashMap<...> >, but HashMap doesn't implement RefCounted. Or do you mean explicit `new`/`delete`?
Brendan Long
Comment 14 2013-07-16 13:12:42 PDT
Created attachment 206810 [details] Return faster, use ASSERT_UNUSED, and use HashMap pointers
Eric Carlson
Comment 15 2013-07-16 14:11:41 PDT
Comment on attachment 206810 [details] Return faster, use ASSERT_UNUSED, and use HashMap pointers Thank you!
WebKit Commit Bot
Comment 16 2013-07-16 14:32:54 PDT
Comment on attachment 206810 [details] Return faster, use ASSERT_UNUSED, and use HashMap pointers Clearing flags on attachment: 206810 Committed r152741: <http://trac.webkit.org/changeset/152741>
WebKit Commit Bot
Comment 17 2013-07-16 14:32:56 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.