Title: [234044] trunk/Source/WebCore
Revision
234044
Author
[email protected]
Date
2018-07-20 09:51:06 -0700 (Fri, 20 Jul 2018)

Log 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:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (234043 => 234044)


--- trunk/Source/WebCore/ChangeLog	2018-07-20 16:51:03 UTC (rev 234043)
+++ trunk/Source/WebCore/ChangeLog	2018-07-20 16:51:06 UTC (rev 234044)
@@ -1,3 +1,20 @@
+2018-07-20  Jer Noble  <[email protected]>
+
+        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:]):
+
 2018-07-19  Antoine Quint  <[email protected]>
 
         Flaky crash in AnimationTimeline::cancelOrRemoveDeclarativeAnimation

Modified: trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm (234043 => 234044)


--- trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm	2018-07-20 16:51:03 UTC (rev 234043)
+++ trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm	2018-07-20 16:51:06 UTC (rev 234044)
@@ -289,8 +289,8 @@
     } else if ([getAVLayerVideoGravityResizeAspectFill() isEqualToString:self.videoGravity]) {
         sourceVideoFrame = smallestRectWithAspectRatioAroundRect(videoAspectRatio, self.modelVideoLayerFrame);
         self.modelVideoLayerFrame = CGRectMake(0, 0, sourceVideoFrame.width(), sourceVideoFrame.height());
-        ASSERT(_fullscreenInterface->videoFullscreenModel());
-        _fullscreenInterface->videoFullscreenModel()->setVideoLayerFrame(self.modelVideoLayerFrame);
+        if (auto* model = _fullscreenInterface->videoFullscreenModel())
+            model->setVideoLayerFrame(self.modelVideoLayerFrame);
         targetVideoFrame = smallestRectWithAspectRatioAroundRect(videoAspectRatio, self.bounds);
     } else
         ASSERT_NOT_REACHED();
@@ -325,8 +325,8 @@
     
     if (!CGRectEqualToRect(self.modelVideoLayerFrame, [self bounds])) {
         self.modelVideoLayerFrame = [self bounds];
-        ASSERT(_fullscreenInterface->videoFullscreenModel());
-        _fullscreenInterface->videoFullscreenModel()->setVideoLayerFrame(self.modelVideoLayerFrame);
+        if (auto* model = _fullscreenInterface->videoFullscreenModel())
+            model->setVideoLayerFrame(self.modelVideoLayerFrame);
     }
     [(UIView *)[_videoSublayer delegate] setTransform:CGAffineTransformIdentity];
     
@@ -350,8 +350,8 @@
     else
         ASSERT_NOT_REACHED();
     
-    ASSERT(_fullscreenInterface->videoFullscreenModel());
-    _fullscreenInterface->videoFullscreenModel()->setVideoLayerGravity(gravity);
+    if (auto* model = _fullscreenInterface->videoFullscreenModel())
+        model->setVideoLayerGravity(gravity);
 }
 
 - (NSString *)videoGravity
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to