| Summary: | Merge Misc. WebVTT Updates from Blink | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> | ||||
| Component: | Media | Assignee: | Brent Fulgham <bfulgham> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | bfulgham, calvaris, commit-queue, eric.carlson, esprehn+autocc, glenn, gyuyoung.kim, jer.noble, philipj, sergio | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Brent Fulgham
2014-03-19 18:06:55 PDT
Created attachment 227240 [details]
Patch
Comment on attachment 227240 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=227240&action=review > Source/WebCore/html/track/VTTCue.cpp:989 > // NOTE: toInt ignores trailing non-digit characters, such as '%'. This comment is no longer necessary because we don't use toInt. > LayoutTests/ChangeLog:31 > + * media/track/track-webvtt-tc027-empty-cue-expected.txt: Marke one test as expected to fail, since Nit: "Marke" Committed r165942: <http://trac.webkit.org/changeset/165942> Comment on attachment 227240 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=227240&action=review I had a very quick look at the style without entering the contents and made a small comment > Source/WebCore/html/track/VTTCue.cpp:973 > + if (!WebVTTParser::collectDigitsToInt(input, &position, number)) This API seems a bit incoherent to me because in a case you pass a pointer to a number and in the other case you pass a reference to a number. For my taste it is more logical and less error prone to stick to one. If you ask me, I'd go for the pointer. > Source/WebCore/html/track/WebVTTParser.cpp:61 > +unsigned WebVTTParser::collectDigitsToInt(const String& input, unsigned* position, int& number) Me previous content refers to this API, of course. (In reply to comment #4) > (From update of attachment 227240 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=227240&action=review > > I had a very quick look at the style without entering the contents and made a small comment > > > Source/WebCore/html/track/VTTCue.cpp:973 > > + if (!WebVTTParser::collectDigitsToInt(input, &position, number)) > > This API seems a bit incoherent to me because in a case you pass a pointer to a number and in the other case you pass a reference to a number. For my taste it is more logical and less error prone to stick to one. If you ask me, I'd go for the pointer. > Good point, I should have thought of that! I vote for passing a reference for both position and value because neither can ever be NULL. (In reply to comment #5) > (In reply to comment #4) > > (From update of attachment 227240 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=227240&action=review > > > > I had a very quick look at the style without entering the contents and made a small comment > > > > > Source/WebCore/html/track/VTTCue.cpp:973 > > > + if (!WebVTTParser::collectDigitsToInt(input, &position, number)) > > > > This API seems a bit incoherent to me because in a case you pass a pointer to a number and in the other case you pass a reference to a number. For my taste it is more logical and less error prone to stick to one. If you ask me, I'd go for the pointer. > > > > Good point, I should have thought of that! > > I vote for passing a reference for both position and value because neither can ever be NULL. Of course your vote weights more than mine, but I'd prefer pointer because the in/out becomes completely clear without the need of specifying any const as parameters are passed as value by default. Maybe it's a reminiscence of my pure C programming skills ;) (In reply to comment #5) > > This API seems a bit incoherent to me because in a case you pass a pointer to a number and in the other case you pass a reference to a number. For my taste it is more logical and less error prone to stick to one. If you ask me, I'd go for the pointer. > > > > Good point, I should have thought of that! Btw, I don't know if Brent thinks of a small follow up patch to fix this nit. |