⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280568 in webkit


Ignore:
Timestamp:
Aug 2, 2021, 4:19:18 PM (5 years ago)
Author:
Jean-Yves Avenard
Message:

Crash in -[WKFullScreenWindowController windowDidExitFullScreen:]
​https://bugs.webkit.org/show_bug.cgi?id=228694
rdar://79569881

Reviewed by Jer Noble.

It appears that [WKFullScreenWindowController finishedEnterFullScreenAnimation] can
cause the retain count to be decreased (this is the only explanation that makes any
sense considering the crash and when the regression started following bug 227243).
No test, can't reproduce.

  • UIProcess/mac/WKFullScreenWindowController.mm:

(-[WKFullScreenWindowController setVideoFullscreenManagerClient:]): Add utility method
to remove duplicated code.
(-[WKFullScreenWindowController didExitPictureInPicture]):
(-[WKFullScreenWindowController windowDidEnterFullScreen:]):
(-[WKFullScreenWindowController windowDidFailToExitFullScreen:]):
(-[WKFullScreenWindowController windowDidExitFullScreen:]):
(-[WKFullScreenWindowController _manager]): fly-by make style consistent with other
similar methods.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r280567 r280568  
     12021-08-02  Jean-Yves Avenard  <jya@apple.com>
     2
     3        Crash in -[WKFullScreenWindowController windowDidExitFullScreen:]
     4        https://bugs.webkit.org/show_bug.cgi?id=228694
     5        rdar://79569881
     6
     7        Reviewed by Jer Noble.
     8
     9        It appears that [WKFullScreenWindowController finishedEnterFullScreenAnimation] can
     10        cause the retain count to be decreased (this is the only explanation that makes any
     11        sense considering the crash and when the regression started following bug 227243).
     12        No test, can't reproduce.
     13
     14        * UIProcess/mac/WKFullScreenWindowController.mm:
     15        (-[WKFullScreenWindowController setVideoFullscreenManagerClient:]): Add utility method
     16        to remove duplicated code.
     17        (-[WKFullScreenWindowController didExitPictureInPicture]):
     18        (-[WKFullScreenWindowController windowDidEnterFullScreen:]):
     19        (-[WKFullScreenWindowController windowDidFailToExitFullScreen:]):
     20        (-[WKFullScreenWindowController windowDidExitFullScreen:]):
     21        (-[WKFullScreenWindowController _manager]): fly-by make style consistent with other
     22        similar methods.
     23
    1242021-08-02  Alex Christensen  <achristensen@webkit.org>
    225
  • trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm

    r280358 r280568  
    646646}
    647647
    648 - (void)didExitPictureInPicture
     648- (void)setVideoFullscreenManagerClient:(WebKit::VideoFullscreenManagerProxyClient *)client
    649649{
    650650    if (auto* videoFullscreenManager = self._videoFullscreenManager) {
    651651        ASSERT(videoFullscreenManager->client() == &_videoFullscreenManagerProxyClient);
    652         videoFullscreenManager->setClient(nullptr);
     652        videoFullscreenManager->setClient(client);
    653653    }
     654}
     655
     656- (void)didExitPictureInPicture
     657{
     658    [self setVideoFullscreenManagerClient:nullptr];
    654659}
    655660
    … …  
    684689- (void)windowDidEnterFullScreen:(NSNotification *)notification
    685690{
     691    RetainPtr<WKFullScreenWindowController> retain = self;
    686692    [self finishedEnterFullScreenAnimation:YES];
    687 
    688     if (auto* videoFullscreenManager = self._videoFullscreenManager) {
    689         ASSERT(videoFullscreenManager->client() == nullptr);
    690         videoFullscreenManager->setClient(&_videoFullscreenManagerProxyClient);
    691     }
     693    [self setVideoFullscreenManagerClient:&_videoFullscreenManagerProxyClient];
    692694}
    693695
    694696- (void)windowDidFailToExitFullScreen:(NSWindow *)window
    695697{
     698    RetainPtr<WKFullScreenWindowController> retain = self;
    696699    [self finishedExitFullScreenAnimation:NO];
     700    [self setVideoFullscreenManagerClient:nullptr];
    697701}
    698702
    699703- (void)windowDidExitFullScreen:(NSNotification *)notification
    700704{
     705    RetainPtr<WKFullScreenWindowController> retain = self;
    701706    [self finishedExitFullScreenAnimation:YES];
    702 
    703     if (auto* videoFullscreenManager = self._videoFullscreenManager) {
    704         ASSERT(videoFullscreenManager->client() == &_videoFullscreenManagerProxyClient);
    705         videoFullscreenManager->setClient(nullptr);
    706     }
     707    [self setVideoFullscreenManagerClient:nullptr];
    707708}
    708709
    … …  
    719720    if (!_page)
    720721        return nullptr;
     722
    721723    return _page->fullScreenManager();
    722724}
Note: See TracChangeset for help on using the changeset viewer.