Audit media task type selection for cleanup |
||
Issue descriptionThis came up in discussion as scheduling team works on deprecating that task type. https://chromium-review.googlesource.com/1002793 We have a bunch of timers using kUnthrottled (now kInternalMedia). Lets see if some of these can be throttled or moved to other task types. Dale, Mounir, et al - PTAL at the analysis below. Near the top of the media element spec (https://html.spec.whatwg.org/#media-element-event-task-source): "Except where otherwise explicitly specified, the task source for all the tasks queued in this section and its subsections is the media element event task source of the media element in question." This task source has its own task time in blink scheduling (kMediaElementEvent): https://cs.chromium.org/chromium/src/third_party/blink/public/platform/task_type.h?rcl=542b6528010bab1bbfd85924bfb7f5bc23338db5&l=50 **So whenever you see "Queue a task" without explicit mention of some other task runner, use kMediaElementEvent** Great context on what/when is backgrounding: https://chromium.googlesource.com/chromium/src/+/lkcr/third_party/WebKit/Source/platform/scheduler/README.md ---HTMLMediaElement timers--- load_timer_ - should be a microtask. https://bugs.chromium.org/p/chromium/issues/detail?id=593289 progress_event_timer_ - should use kMediaElementEvent. all about scheduling the progress/stalled events. audio_tracks_timer_ - just used to push down track changes to wmpi on the next tick (timer is always started with value 0) - we definitely wouldn't want it throttled, but perhaps this is better off as a microtask? check_viewport_intersection_timer_ - scared to throttle this one. seems one candidate for throttling is "hidden" stuff. Waiting 1 second to know that the user has scrolled the video to the middle of the screen would be bad. deferred_load_timer_ - should use kMediaElementEvent - "Queue a task to set the element's delaying-the-load-event flag to false." ---WMPI timers needing attention--- memory_usage_reporting_timer_ -- not sure. I don't know how rapidly/regularly v8 needs these stats. video_decode_stats_reporter_ -- probably fine to throttle watch_time_stats_reporter_ -- probably fine to throttle --- MISC kUnthrottled (now kInternalMedia) usages I'm less familiar with --- renderer_webmediaplayer_delegate.cc - idle_cleanup_timer_ media_remoting_interstitial.cc - toggle_interstitial_timer_ picture_in_picture_interstitial.cc - interstitial_timer_ html_media_element_capture.cc - CreateHTMLVideoElementCapturer
,
Apr 25 2018
,
Apr 25 2018
Mounir, Dale - friendly ping for feedback / open questions in the initial report. |
||
►
Sign in to add a comment |
||
Comment 1 by hajimehoshi@chromium.org
, Apr 25 2018