Skip to content

Commit

Permalink
REGRESSION (274626@main): [ iOS Debug ]media/video-autoplay.html and …
Browse files Browse the repository at this point in the history
…media/video-element-other-n amespace-crash.html are constant crashes (270485)

https://bugs.webkit.org/show_bug.cgi?id=270715
rdar://124034839

Reviewed by Jer Noble.

Replacing CompletionHandler with Function to fix crash caused by not calling
the completion handler in all cases. Unskipping tests that were affected.

* LayoutTests/platform/ios-wk2/TestExpectations:
* Source/WebCore/platform/ios/VideoPresentationInterfaceAVKit.h:
* Source/WebCore/platform/ios/VideoPresentationInterfaceAVKit.mm:
(WebCore::VideoPresentationInterfaceAVKit::presentFullscreen):
(WebCore::VideoPresentationInterfaceAVKit::dismissFullscreen):
* Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.h:
* Source/WebKit/Platform/ios/VideoPresentationInterfaceLMK.h:
* Source/WebKit/Platform/ios/VideoPresentationInterfaceLMK.mm:
(WebKit::VideoPresentationInterfaceLMK::presentFullscreen):
(WebKit::VideoPresentationInterfaceLMK::dismissFullscreen):

Canonical link: https://commits.webkit.org/275930@main
  • Loading branch information
danae404 authored and jernoble committed Mar 11, 2024
1 parent 19739c6 commit 26d42d0
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
4 changes: 0 additions & 4 deletions LayoutTests/platform/ios-wk2/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -2401,7 +2401,3 @@ webkit.org/b/269321 webgl/1.0.3/conformance/uniforms/out-of-bounds-uniform-array
webkit.org/b/269760 mathml/presentation/scripts-underover.html [ Failure ]

webkit.org/b/270477 [ Debug ] accessibility/text-marker/text-marker-range-stale-node-crash.html [ Skip ]

# webkit.org/b/268557 REGRESSION (274621@main-274598@main?): [ iOS Debug ]media/video-autoplay.html and media/video-element-other-namespace-crash.html are constant crashes
[ Debug ] media/video-autoplay.html [ Skip ]
[ Debug ] media/video-element-other-namespace-crash.html [ Skip ]
4 changes: 2 additions & 2 deletions Source/WebCore/platform/ios/VideoPresentationInterfaceAVKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class VideoPresentationInterfaceAVKit final : public VideoPresentationInterfaceI
WEBCORE_EXPORT bool mayAutomaticallyShowVideoPictureInPicture() const;
bool isPlayingVideoInEnhancedFullscreen() const;
bool allowsPictureInPicturePlayback() const { return m_allowsPictureInPicturePlayback; }
void presentFullscreen(bool animated, CompletionHandler<void(BOOL, NSError *)>&&) final;
void dismissFullscreen(bool animated, CompletionHandler<void(BOOL, NSError *)>&&) final;
void presentFullscreen(bool animated, Function<void(BOOL, NSError *)>&&) final;
void dismissFullscreen(bool animated, Function<void(BOOL, NSError *)>&&) final;

private:
WEBCORE_EXPORT VideoPresentationInterfaceAVKit(PlaybackSessionInterfaceIOS&);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,12 +852,12 @@ - (WTFLogChannel*)logChannel
m_playerViewController = nil;
}

void VideoPresentationInterfaceAVKit::presentFullscreen(bool animated, CompletionHandler<void(BOOL, NSError *)>&& completionHandler)
void VideoPresentationInterfaceAVKit::presentFullscreen(bool animated, Function<void(BOOL, NSError *)>&& completionHandler)
{
[m_playerViewController enterFullScreenAnimated:animated completionHandler:makeBlockPtr(WTFMove(completionHandler)).get()];
}

void VideoPresentationInterfaceAVKit::dismissFullscreen(bool animated, CompletionHandler<void(BOOL, NSError *)>&& completionHandler)
void VideoPresentationInterfaceAVKit::dismissFullscreen(bool animated, Function<void(BOOL, NSError *)>&& completionHandler)
{
[m_playerViewController exitFullScreenAnimated:animated completionHandler:makeBlockPtr(WTFMove(completionHandler)).get()];
}
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/platform/ios/VideoPresentationInterfaceIOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ class VideoPresentationInterfaceIOS
WEBCORE_EXPORT void exitFullscreenHandler(BOOL success, NSError *, NextActions = NextActions());
void doEnterFullscreen();
void doExitFullscreen();
virtual void presentFullscreen(bool animated, CompletionHandler<void(BOOL, NSError *)>&&) = 0;
virtual void dismissFullscreen(bool animated, CompletionHandler<void(BOOL, NSError *)>&&) = 0;
virtual void presentFullscreen(bool animated, Function<void(BOOL, NSError *)>&&) = 0;
virtual void dismissFullscreen(bool animated, Function<void(BOOL, NSError *)>&&) = 0;
virtual void tryToStartPictureInPicture() = 0;
virtual void stopPictureInPicture() = 0;
virtual void setShowsPlaybackControls(bool) = 0;
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit/Platform/ios/VideoPresentationInterfaceLMK.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class VideoPresentationInterfaceLMK : public VideoPresentationInterfaceIOS {
UIViewController *playerViewController() const final;
void tryToStartPictureInPicture() final { }
void stopPictureInPicture() final { }
void presentFullscreen(bool animated, CompletionHandler<void(BOOL, NSError *)>&&) final;
void dismissFullscreen(bool animated, CompletionHandler<void(BOOL, NSError *)>&&) final;
void presentFullscreen(bool animated, Function<void(BOOL, NSError *)>&&) final;
void dismissFullscreen(bool animated, Function<void(BOOL, NSError *)>&&) final;
void setShowsPlaybackControls(bool) final;
void setContentDimensions(const FloatSize&) final;
void setAllowsPictureInPicturePlayback(bool) final { }
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit/Platform/ios/VideoPresentationInterfaceLMK.mm
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@
m_playerViewController = nil;
}

void VideoPresentationInterfaceLMK::presentFullscreen(bool animated, CompletionHandler<void(BOOL, NSError *)>&& completionHandler)
void VideoPresentationInterfaceLMK::presentFullscreen(bool animated, Function<void(BOOL, NSError *)>&& completionHandler)
{
linearMediaPlayer().presentationMode = WKSLinearMediaPresentationModeFullscreenFromInline;
// FIXME: Wait until -linearMediaPlayer:didEnterFullscreenWithError: is called before calling completionHandler
completionHandler(YES, nil);
}

void VideoPresentationInterfaceLMK::dismissFullscreen(bool animated, CompletionHandler<void(BOOL, NSError *)>&& completionHandler)
void VideoPresentationInterfaceLMK::dismissFullscreen(bool animated, Function<void(BOOL, NSError *)>&& completionHandler)
{
linearMediaPlayer().presentationMode = WKSLinearMediaPresentationModeInline;
// FIXME: Wait until -linearMediaPlayer:didExitFullscreenWithError: is called before calling completionHandler
Expand Down

0 comments on commit 26d42d0

Please sign in to comment.