Fix crash when entering fullscreen during exit fullscreen animation.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jun 2015 23:38:55 +0000 (23:38 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jun 2015 23:38:55 +0000 (23:38 +0000)
commitcdb7b10e6e14767280c96e8e80c5207a66c40995
tree5d95205d5e49f397e5af9c2ef72df30017157b57
parent87c259da13f53feb11c590efd83e03f50bdbbde2
Fix crash when entering fullscreen during exit fullscreen animation.
https://bugs.webkit.org/show_bug.cgi?id=146117

Patch by Jeremy Jones <jeremyj@apple.com> on 2015-06-18
Reviewed by Simon Fraser.

Source/WebCore:

Because enterFullscreen can be called during exitFullscreen animation, the exit fullscreen teardown
should not imply a fullscreen state change on video element.

* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(WebVideoFullscreenControllerContext::exitFullscreen): May be called from mainThread
(-[WebVideoFullscreenController exitFullscreen]): May be called from mainThread
* platform/ios/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::setVideoElement):
Changing associated video element does not imply fullscreen mode change.

Source/WebKit2:

A partial teardown left the LayerHostingContext in a bad state when attempting to reuse the model and interface
objects. Instead, complete the teardown and don't reuse the objects.

* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::didEnterFullscreen): WebThreadRun is a no-op in WK2. Use dispatch_async.
(WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Do complete teardown before entering fullscreen again.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm