Bug 204030 - Make MediaStream/MediaStreamTrack page cache friendly
Summary: Make MediaStream/MediaStreamTrack page cache friendly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
: 203094 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-11-08 16:30 PST by youenn fablet
Modified: 2019-11-26 11:04 PST (History)
13 users (show)

See Also:


Attachments
Patch (8.20 KB, patch)
2019-11-08 17:10 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (8.92 KB, patch)
2019-11-08 18:47 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (5.49 KB, patch)
2019-11-11 09:37 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (8.23 KB, patch)
2019-11-11 09:58 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2019-11-08 16:30:02 PST
Make MediaStream/MediaStreamTrack page cache friendly
Comment 1 youenn fablet 2019-11-08 17:10:58 PST
Created attachment 383183 [details]
Patch
Comment 2 youenn fablet 2019-11-08 18:47:30 PST
Created attachment 383192 [details]
Patch
Comment 3 Chris Dumez 2019-11-08 18:58:53 PST
Comment on attachment 383192 [details]
Patch

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

> Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp:578
> +    scriptExecutionContext()->postTask([this, pendingActivity = makePendingActivity(*this)](auto&) {

We're not supposed to use postTask() anymore. Please use the HTML event loop by calling queueTaskToDispatchEvent().

Also, because the HTML event loop is page-cache compliant, you can call queueTaskToDispatchEvent() in suspend() and then you don't need a resume() method or the m_isSuspendedForBackForwardCache flag.
Comment 4 youenn fablet 2019-11-11 09:37:35 PST
Created attachment 383276 [details]
Patch
Comment 5 youenn fablet 2019-11-11 09:58:58 PST
Created attachment 383278 [details]
Patch
Comment 6 Chris Dumez 2019-11-11 10:06:35 PST
Comment on attachment 383278 [details]
Patch

r=me if the bots are happy.
Comment 7 WebKit Commit Bot 2019-11-11 13:41:17 PST
Comment on attachment 383278 [details]
Patch

Clearing flags on attachment: 383278

Committed r252337: <https://trac.webkit.org/changeset/252337>
Comment 8 WebKit Commit Bot 2019-11-11 13:41:19 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Chris Dumez 2019-11-26 11:03:56 PST
*** Bug 203094 has been marked as a duplicate of this bug. ***
Comment 10 Radar WebKit Bug Importer 2019-11-26 11:04:17 PST
<rdar://problem/57493528>