[webkit-reviews] review granted: [Bug 128976] Do not cache media time until media engine returns a non-zero value : [Attachment 224518] Proposed patch.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 18 09:13:33 PST 2014


Jer Noble <jer.noble at apple.com> has granted Eric Carlson
<eric.carlson at apple.com>'s request for review:
Bug 128976: Do not cache media time until media engine returns a non-zero value
https://bugs.webkit.org/show_bug.cgi?id=128976

Attachment 224518: Proposed patch.
https://bugs.webkit.org/attachment.cgi?id=224518&action=review

------- Additional Comments from Jer Noble <jer.noble at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=224518&action=review


r=me, with nits.

> Source/WebCore/ChangeLog:4
> +	   Do not cache media time until media engine returns a non-zero value
> +	   https://bugs.webkit.org/show_bug.cgi?id=128976

This doesn't say _why_ we shouldn't cache the media time in this case.

> Source/WebCore/html/HTMLMediaElement.cpp:2446
> +    if (m_cachedTime) {
> +	   LOG(Media, "HTMLMediaElement::refreshCachedTime - caching time %f",
m_cachedTime);
> +	   m_clockTimeAtLastCachedTimeUpdate = monotonicallyIncreasingTime();
> +    } else
> +	   invalidateCachedTime();

I would structure this a little differently, to be a bit more clear about
what's going on:

if (!m_cachedTime) {
    // Short comment about why not caching a 0-currentTime is the right thing
to do.
    invalidateCachedTime();
    return;
}

LOG(Media, "HTMLMediaElement::refreshCachedTime - caching time %f",
m_cachedTime);
m_clockTimeAtLastCachedTimeUpdate = monotonicallyIncreasingTime();


More information about the webkit-reviews mailing list