exitFullscreen should not instantiate a new model/interface mapping.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2019 23:40:44 +0000 (23:40 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Feb 2019 23:40:44 +0000 (23:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191988
rdar://problem/42327939

Patch by Jeremy Jones <jeremyj@apple.com> on 2019-02-18
Reviewed by Jer Noble.

This change is a speculative fix for a crash that cannot be reproduced.

Somehow, exitFullscreen is being requested after didCleanupFullscreen has completed.
This change should allow us to prevent the crash in release, and assert in debug.

* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::exitFullscreen):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241745 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm

index 3a02ceb..334a9b2 100644 (file)
@@ -1,3 +1,19 @@
+2019-02-18  Jeremy Jones  <jeremyj@apple.com>
+
+        exitFullscreen should not instantiate a new model/interface mapping.
+        https://bugs.webkit.org/show_bug.cgi?id=191988
+        rdar://problem/42327939
+
+        Reviewed by Jer Noble.
+
+        This change is a speculative fix for a crash that cannot be reproduced.
+
+        Somehow, exitFullscreen is being requested after didCleanupFullscreen has completed.
+        This change should allow us to prevent the crash in release, and assert in debug.
+
+        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
+        (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
+
 2019-02-18  John Wilander  <wilander@apple.com>
 
         Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess()
index 4cf30bf..cc6037d 100644 (file)
@@ -531,6 +531,10 @@ void VideoFullscreenManagerProxy::enterFullscreen(uint64_t contextId)
 
 void VideoFullscreenManagerProxy::exitFullscreen(uint64_t contextId, WebCore::IntRect finalRect)
 {
+    ASSERT(m_contextMap.contains(contextId));
+    if (!m_contextMap.contains(contextId))
+        return;
+
 #if PLATFORM(IOS_FAMILY)
     ensureInterface(contextId).exitFullscreen(finalRect);
 #else