Summary: | [GPUP] Use MonotonicTime for elapsed time | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Eric Carlson <eric.carlson> | ||||||
Component: | Media | Assignee: | Eric Carlson <eric.carlson> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | ews-watchlist, glenn, jer.noble, philipj, sergio, simon.fraser, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=225245 | ||||||||
Attachments: |
|
Description
Eric Carlson
2021-05-03 14:34:01 PDT
Created attachment 427604 [details]
Patch
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. Created attachment 427612 [details]
Patch for landing
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]. |