Invalidate WebVideoFullscreenManager when WebPage is destroyed.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Jun 2017 22:36:45 +0000 (22:36 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Jun 2017 22:36:45 +0000 (22:36 +0000)
commit0b36a69697e0d768f9ac80ba3626b999f4dfcc38
treea0d0f97d4b66ce45c0e207913dd9b9931d6366dd
parentdc4e79556a7e77f28c0f3080ff27938274bafc0d
Invalidate WebVideoFullscreenManager when WebPage is destroyed.
https://bugs.webkit.org/show_bug.cgi?id=173835
rdar://problem/32969161

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

WebVideoFullscreenManager has a pointer to WebPage, and even null checks it in a few places,
but the only place it is nulled out is in the destructor. This allows a dangling reference.

This changes invalidates that reference when WebPage is destructed and adds nullchecks
or asserts throughout WebVideoFullscreenManager as appropriate.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::~WebPage):
* WebProcess/cocoa/WebVideoFullscreenManager.h:
(WebKit::WebVideoFullscreenManager::invalidate):
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager):
(WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
(WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
(WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
(WebKit::WebVideoFullscreenManager::hasVideoChanged):
(WebKit::WebVideoFullscreenManager::videoDimensionsChanged):
(WebKit::WebVideoFullscreenManager::didSetupFullscreen):
(WebKit::WebVideoFullscreenManager::didEnterFullscreen):
(WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
(WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@218822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h
Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm