Add very basic PageCache support for RTCPeerConnection.
Created attachment 379588 [details] Patch
<rdar://problem/55723524>
Comment on attachment 379588 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=379588&action=review > Source/WebCore/Modules/mediastream/RTCPeerConnection.h:190 > + promise.whenSettled([pendingActivity = makeRefPtr(makePendingActivity(*this).ptr())] { }); Why not just make whenSettled take a WTF::Function?
Created attachment 379613 [details] Patch
Comment on attachment 379613 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=379613&action=review r=me > Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp:502 > + // FIXME: We should do better here, it is way too easy to prevent PageCache. > bool RTCPeerConnection::canSuspendForDocumentSuspension() const > { > return !hasPendingActivity(); I kinda think we should be able to remove this. Pending promised will be resolved before any navigation. And events are OK to delay.
(In reply to Geoffrey Garen from comment #5) > Comment on attachment 379613 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=379613&action=review > > r=me > > > Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp:502 > > + // FIXME: We should do better here, it is way too easy to prevent PageCache. > > bool RTCPeerConnection::canSuspendForDocumentSuspension() const > > { > > return !hasPendingActivity(); > > I kinda think we should be able to remove this. Pending promised will be > resolved before any navigation. And events are OK to delay. Promises are guaranteed to be resolved before navigating away? What if I call a JS function that returns a promise from inside the pagehide event handler?
> Promises are guaranteed to be resolved before navigating away? What if I > call a JS function that returns a promise from inside the pagehide event > handler? Maybe I misread this code. I guess this is a set of promises that will resolve when future events happen? Yeah, I guess we would need to implement an explicit way to delay them if so.
Comment on attachment 379613 [details] Patch Clearing flags on attachment: 379613 Committed r250379: <https://trac.webkit.org/changeset/250379>
All reviewed patches have been landed. Closing bug.