RESOLVED FIXED Bug 225329
[GPUP] Use MonotonicTime for elapsed time
https://bugs.webkit.org/show_bug.cgi?id=225329
Summary [GPUP] Use MonotonicTime for elapsed time
Eric Carlson
Reported 2021-05-03 14:34:01 PDT
MediaPlayerPrivateRemote and RemoteMediaPlayerProxy should use MonotonicTime instead of WallTime
Attachments
Patch (17.44 KB, patch)
2021-05-03 14:44 PDT, Eric Carlson
no flags
Patch for landing (17.33 KB, patch)
2021-05-03 16:05 PDT, Eric Carlson
no flags
Radar WebKit Bug Importer
Comment 1 2021-05-03 14:34:11 PDT
Eric Carlson
Comment 2 2021-05-03 14:44:01 PDT
Simon Fraser (smfr)
Comment 3 2021-05-03 15:04:05 PDT
Comment on attachment 427604 [details] 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.
Eric Carlson
Comment 4 2021-05-03 16:05:04 PDT
Created attachment 427612 [details] Patch for landing
EWS
Comment 5 2021-05-04 11:44:01 PDT
Committed r276973 (237302@main): <https://commits.webkit.org/237302@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 427612 [details].
Note You need to log in before you can comment on or make changes to this bug.