[webkit-reviews] review granted: [Bug 225329] [GPUP] Use MonotonicTime for elapsed time : [Attachment 427604] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 3 15:04:05 PDT 2021


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Eric Carlson
<eric.carlson at apple.com>'s request for review:
Bug 225329: [GPUP] Use MonotonicTime for elapsed time
https://bugs.webkit.org/show_bug.cgi?id=225329

Attachment 427604: Patch

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




--- Comment #3 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 427604
  --> https://bugs.webkit.org/attachment.cgi?id=427604
Patch

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

> Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp:976
> -    auto transmissionTime = MediaTime::createWithDouble((WallTime::now() -
messageTime).value(), 1);
> +    auto transmissionTime =
MediaTime::createWithDouble((MonotonicTime::now() - messageTime).value(), 1);
>      auto adjustedTaskTime = taskTime - transmissionTime;
>      auto currentTime = m_player->currentTime();
>      if (adjustedTaskTime <= currentTime) {
> -	   completionHandler(currentTime, WallTime::now());
> +	   completionHandler(currentTime, MonotonicTime::now());

I hate seeing code that fetches current time more than once in the same
function (time will have advanced slightly, plus it has cost). So compute 'now'
just once.

> Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerState.h:40
> +    MonotonicTime monotonicTime;

The name of the member says what it is, but not what it does.


More information about the webkit-reviews mailing list