[webkit-reviews] review granted: [Bug 217228] Multiple calls to suspend media playback for the same page may result in resuming media playback too soon : [Attachment 410366] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 2 15:10:53 PDT 2020


Eric Carlson <eric.carlson at apple.com> has granted katherine_cheney at apple.com's
request for review:
Bug 217228: Multiple calls to suspend media playback for the same page may
result in resuming media playback too soon
https://bugs.webkit.org/show_bug.cgi?id=217228

Attachment 410366: Patch

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




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

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

> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:1897
> +    return (NSInteger
*)(static_cast<long>(_page->suspendMediaPlaybackCounter()));

can you `return @(_page->suspendMediaPlaybackCounter())` ?

> Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:345
> +- (NSInteger *)_suspendMediaPlaybackCounter
WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));

This should probably be WKWebViewPrivateForTesting.h

> Source/WebKit/UIProcess/WebPageProxy.cpp:6045
> +    if (!m_mediaPlaybackIsSuspended || m_suspendMediaPlaybackCounter > 0)

if (!m_mediaPlaybackIsSuspended || m_suspendMediaPlaybackCounter)

> Tools/TestWebKitAPI/Tests/WebKitCocoa/StopSuspendResumeAllMedia.mm:115
> +	   auto counter = [webView _suspendMediaPlaybackCounter];
> +	   if (counter >= (NSInteger *)(static_cast<long>(2)))

if ([webView _suspendMediaPlaybackCounter] <= @(2))

> Tools/TestWebKitAPI/Tests/WebKitCocoa/StopSuspendResumeAllMedia.mm:123
> +	   auto counter = [webView _suspendMediaPlaybackCounter];
> +	   if (counter <= (NSInteger *)(static_cast<long>(1)))

if ([webView _suspendMediaPlaybackCounter] <= @(1))


More information about the webkit-reviews mailing list