Changeset 234044 in webkit


Ignore:
Timestamp:
Jul 20, 2018 9:51:06 AM (6 years ago)
Author:
jer.noble@apple.com
Message:

REGRESSION(r233969): ASSERT in -[WebAVPlayerLayer setVideoGravity:]
https://bugs.webkit.org/show_bug.cgi?id=187814
<rdar://problem/42391869>

Reviewed by Eric Carlson.

After r233969 caused models to disassociate themselves from interfaces, it is now possible that an
VideoFullscreenInterfaceAVKit can have a nil model. We should null-check, not ASSERT, now that the
assertion no longer holds true.

  • platform/ios/VideoFullscreenInterfaceAVKit.mm:

(-[WebAVPlayerLayer layoutSublayers]):
(-[WebAVPlayerLayer resolveBounds]):
(-[WebAVPlayerLayer setVideoGravity:]):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r234017 r234044  
     12018-07-20  Jer Noble  <jer.noble@apple.com>
     2
     3        REGRESSION(r233969): ASSERT in -[WebAVPlayerLayer setVideoGravity:]
     4        https://bugs.webkit.org/show_bug.cgi?id=187814
     5        <rdar://problem/42391869>
     6
     7        Reviewed by Eric Carlson.
     8
     9        After r233969 caused models to disassociate themselves from interfaces, it is now possible that an
     10        VideoFullscreenInterfaceAVKit can have a nil model. We should null-check, not ASSERT, now that the
     11        assertion no longer holds true.
     12
     13        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
     14        (-[WebAVPlayerLayer layoutSublayers]):
     15        (-[WebAVPlayerLayer resolveBounds]):
     16        (-[WebAVPlayerLayer setVideoGravity:]):
     17
    1182018-07-19  Antoine Quint  <graouts@apple.com>
    219
  • trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm

    r233930 r234044  
    290290        sourceVideoFrame = smallestRectWithAspectRatioAroundRect(videoAspectRatio, self.modelVideoLayerFrame);
    291291        self.modelVideoLayerFrame = CGRectMake(0, 0, sourceVideoFrame.width(), sourceVideoFrame.height());
    292         ASSERT(_fullscreenInterface->videoFullscreenModel());
    293         _fullscreenInterface->videoFullscreenModel()->setVideoLayerFrame(self.modelVideoLayerFrame);
     292        if (auto* model = _fullscreenInterface->videoFullscreenModel())
     293            model->setVideoLayerFrame(self.modelVideoLayerFrame);
    294294        targetVideoFrame = smallestRectWithAspectRatioAroundRect(videoAspectRatio, self.bounds);
    295295    } else
     
    326326    if (!CGRectEqualToRect(self.modelVideoLayerFrame, [self bounds])) {
    327327        self.modelVideoLayerFrame = [self bounds];
    328         ASSERT(_fullscreenInterface->videoFullscreenModel());
    329         _fullscreenInterface->videoFullscreenModel()->setVideoLayerFrame(self.modelVideoLayerFrame);
     328        if (auto* model = _fullscreenInterface->videoFullscreenModel())
     329            model->setVideoLayerFrame(self.modelVideoLayerFrame);
    330330    }
    331331    [(UIView *)[_videoSublayer delegate] setTransform:CGAffineTransformIdentity];
     
    351351        ASSERT_NOT_REACHED();
    352352   
    353     ASSERT(_fullscreenInterface->videoFullscreenModel());
    354     _fullscreenInterface->videoFullscreenModel()->setVideoLayerGravity(gravity);
     353    if (auto* model = _fullscreenInterface->videoFullscreenModel())
     354        model->setVideoLayerGravity(gravity);
    355355}
    356356
Note: See TracChangeset for help on using the changeset viewer.