Handle timeout of prepareForPictureInPictureStopWithCompletionHandler.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jun 2017 22:56:44 +0000 (22:56 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jun 2017 22:56:44 +0000 (22:56 +0000)
commit9a49e56c073c3b0d2d92655a071679c727538f84
treed0801021a104d704f064851fe7bf202c3797ea8c
parent09aa41cab67dda7171746d4e7f80fb2d1d814e65
Handle timeout of prepareForPictureInPictureStopWithCompletionHandler.
https://bugs.webkit.org/show_bug.cgi?id=173462
rdar://problem/32128170

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-06-16
Reviewed by Jer Noble.

No new tests because no effect on the DOM.

If WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler doesn't respond fast enough,
the caller will timeout and call will/didStopPictureInPicture.

This is getting fullscreen state confused.

This change keeps state consistent by handling will/didStopPictureInPicture possibly being called before
prepareForPictureInPictureStopWithCompletionHandler calls its callback.

* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture):
(WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture):
(WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
(WebVideoFullscreenInterfaceAVKit::watchdogTimerFired):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm