[webkit-reviews] review granted: [Bug 192829] [WebKitLegacy] Media playback pauses on scroll : [Attachment 357615] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 21 13:16:45 PST 2018


Eric Carlson <eric.carlson at apple.com> has granted Jer Noble
<jer.noble at apple.com>'s request for review:
Bug 192829: [WebKitLegacy] Media playback pauses on scroll
https://bugs.webkit.org/show_bug.cgi?id=192829

Attachment 357615: Patch

https://bugs.webkit.org/attachment.cgi?id=357615&action=review




--- Comment #6 from Eric Carlson <eric.carlson at apple.com> ---
Comment on attachment 357615
  --> https://bugs.webkit.org/attachment.cgi?id=357615
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=357615&action=review

> Source/WebCore/dom/Document.cpp:1727
> +	   platformMediaSessionManager->stopAllMediaPlaybackForDocument(this);

Nit: you might as well update stopAllMediaPlaybackForDocument to take a
Document reference.

> Source/WebCore/html/HTMLMediaElement.cpp:834
> +	   INFO_LOG(LOGIDENTIFIER, "src = ", value);

We shouldn't log urls in release builds. You can have this only log in a debug
build by changing it to something like 

    INFO_LOG(LOGIDENTIFIER, "src = ", URL { URL { }, value });

> Source/WebCore/page/Page.cpp:1738
> +    for (Frame* frame = &mainFrame(); frame; frame =
frame->tree().traverseNext()) {
> +	   if (auto* document = frame->document())
> +	       document->suspendAllMediaPlayback();
> +    }
> +
> +    m_mediaPlaybackIsSuspended = true;

Nit: it is probably slightly safer to set m_mediaPlaybackIsSuspended before
suspending the documents, in case they do something that causes this to be
called again.


More information about the webkit-reviews mailing list