Skip to content

Commit 90d028c

Browse files
Fix fullscreen video size from site isolated iframes
https://bugs.webkit.org/show_bug.cgi?id=294616 rdar://147956565 Reviewed by Eric Carlson. VideoPresentationManager::EnsureUpdatedVideoDimensions and VideoPresentationManager::SetVideoLayerFrameFenced are both necessary to properly update the size of a video when entering fullscreen. With site isolation on, they were sent to the wrong process. This sends them to the correct process. * Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.h: * Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.mm: (WebKit::VideoPresentationManagerProxy::createLayerWithID): (WebKit::VideoPresentationManagerProxy::createViewWithID): (WebKit::VideoPresentationManagerProxy::setHasVideo): (WebKit::VideoPresentationManagerProxy::setVideoLayerFrame): (WebKit::VideoPresentationManagerProxy::setVideoLayerGravity): Canonical link: https://commits.webkit.org/296380@main
1 parent ed9f7db commit 90d028c

17 files changed

Lines changed: 417 additions & 409 deletions

Source/WebKit/Scripts/webkit/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,6 @@ def serialized_identifiers():
449449
'WebKit::NetworkResourceLoadIdentifier',
450450
'WebKit::PDFPluginIdentifier',
451451
'WebKit::PageGroupIdentifier',
452-
'WebKit::PlaybackSessionContextIdentifier',
453452
'WebKit::QuotaIncreaseRequestIdentifier',
454453
'WebKit::RemoteAudioDestinationIdentifier',
455454
'WebKit::RemoteAudioHardwareListenerIdentifier',
@@ -586,6 +585,7 @@ def types_that_cannot_be_forward_declared():
586585
'WebKit::InputMethodState',
587586
'WebKit::LayerHostingContextID',
588587
'WebKit::LegacyCustomProtocolID',
588+
'WebKit::PlaybackSessionContextIdentifier',
589589
'WebKit::RemoteImageBufferSetIdentifier',
590590
'WebKit::RemoteMediaSourceIdentifier',
591591
'WebKit::RemoteSourceBufferIdentifier',

Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,6 @@ Vector<ASCIILiteral> serializedIdentifiers()
466466
"WebKit::NetworkResourceLoadIdentifier"_s,
467467
"WebKit::PDFPluginIdentifier"_s,
468468
"WebKit::PageGroupIdentifier"_s,
469-
"WebKit::PlaybackSessionContextIdentifier"_s,
470469
"WebKit::QuotaIncreaseRequestIdentifier"_s,
471470
"WebKit::RemoteAudioDestinationIdentifier"_s,
472471
"WebKit::RemoteAudioHardwareListenerIdentifier"_s,

Source/WebKit/Shared/PlaybackSessionContextIdentifier.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@
2626
#pragma once
2727

2828
#include <WebCore/HTMLMediaElementIdentifier.h>
29+
#include <WebCore/ProcessQualified.h>
2930

3031
namespace WebKit {
3132

32-
using PlaybackSessionContextIdentifier = WebCore::HTMLMediaElementIdentifier;
33+
using PlaybackSessionContextIdentifier = WebCore::ProcessQualified<WebCore::HTMLMediaElementIdentifier>;
34+
35+
inline PlaybackSessionContextIdentifier processQualify(WebCore::HTMLMediaElementIdentifier identifier)
36+
{
37+
return WebCore::ProcessQualified(identifier, WebCore::Process::identifier());
38+
}
3339

3440
}

Source/WebKit/Shared/ProcessQualified.serialization.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,8 @@ header: <WebCore/ProcessQualified.h>
9898
WebKit::TransactionIdentifier object();
9999
WebCore::ProcessIdentifier processIdentifier();
100100
};
101+
102+
[Alias=class WebCore::ProcessQualified<ObjectIdentifier<WebCore::MediaPlayerClientIdentifierType>>, CustomHeader] alias WebKit::PlaybackSessionContextIdentifier {
103+
WebCore::MediaPlayerClientIdentifier object();
104+
WebCore::ProcessIdentifier processIdentifier();
105+
};

Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ class PlaybackSessionManagerProxy
273273
explicit PlaybackSessionManagerProxy(WebPageProxy&);
274274
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final;
275275

276+
template <typename Message> void sendToWebProcess(PlaybackSessionContextIdentifier, Message&&);
277+
276278
typedef std::tuple<Ref<PlaybackSessionModelContext>, Ref<WebCore::PlatformPlaybackSessionInterface>> ModelInterfaceTuple;
277279
ModelInterfaceTuple createModelAndInterface(PlaybackSessionContextIdentifier);
278280
const ModelInterfaceTuple& ensureModelAndInterface(PlaybackSessionContextIdentifier);

Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,40 +28,40 @@
2828
DispatchedTo=UI
2929
]
3030
messages -> PlaybackSessionManagerProxy {
31-
CurrentTimeChanged(WebCore::MediaPlayerClientIdentifier contextId, double currentTime, double hostTime)
32-
BufferedTimeChanged(WebCore::MediaPlayerClientIdentifier contextId, double bufferedTime)
33-
SeekableRangesVectorChanged(WebCore::MediaPlayerClientIdentifier contextId, WebCore::PlatformTimeRanges ranges, double lastModifiedTime, double liveUpdateInterval)
34-
CanPlayFastReverseChanged(WebCore::MediaPlayerClientIdentifier contextId, bool value)
35-
AudioMediaSelectionOptionsChanged(WebCore::MediaPlayerClientIdentifier contextId, Vector<WebCore::MediaSelectionOption> options, uint64_t selectedIndex)
36-
LegibleMediaSelectionOptionsChanged(WebCore::MediaPlayerClientIdentifier contextId, Vector<WebCore::MediaSelectionOption> options, uint64_t selectedIndex)
37-
AudioMediaSelectionIndexChanged(WebCore::MediaPlayerClientIdentifier contextId, uint64_t selectedIndex)
38-
LegibleMediaSelectionIndexChanged(WebCore::MediaPlayerClientIdentifier contextId, uint64_t selectedIndex)
39-
ExternalPlaybackPropertiesChanged(WebCore::MediaPlayerClientIdentifier contextId, bool enabled, enum:uint8_t WebCore::PlaybackSessionModelExternalPlaybackTargetType targetType, String localizedDeviceName)
40-
WirelessVideoPlaybackDisabledChanged(WebCore::MediaPlayerClientIdentifier contextId, bool disabled)
41-
DurationChanged(WebCore::MediaPlayerClientIdentifier contextId, double duration)
42-
PlaybackStartedTimeChanged(WebCore::MediaPlayerClientIdentifier contextId, double playbackStartedTime)
43-
RateChanged(WebCore::MediaPlayerClientIdentifier contextId, OptionSet<WebCore::PlaybackSessionModelPlaybackState> playbackState, double rate, double defaultPlaybackRate)
44-
MutedChanged(WebCore::MediaPlayerClientIdentifier contextId, bool muted);
45-
VolumeChanged(WebCore::MediaPlayerClientIdentifier contextId, double volume);
46-
PictureInPictureSupportedChanged(WebCore::MediaPlayerClientIdentifier contextId, bool pictureInPictureSupported)
47-
IsInWindowFullscreenActiveChanged(WebCore::MediaPlayerClientIdentifier contextId, bool isInWindow)
31+
CurrentTimeChanged(WebKit::PlaybackSessionContextIdentifier contextId, double currentTime, double hostTime)
32+
BufferedTimeChanged(WebKit::PlaybackSessionContextIdentifier contextId, double bufferedTime)
33+
SeekableRangesVectorChanged(WebKit::PlaybackSessionContextIdentifier contextId, WebCore::PlatformTimeRanges ranges, double lastModifiedTime, double liveUpdateInterval)
34+
CanPlayFastReverseChanged(WebKit::PlaybackSessionContextIdentifier contextId, bool value)
35+
AudioMediaSelectionOptionsChanged(WebKit::PlaybackSessionContextIdentifier contextId, Vector<WebCore::MediaSelectionOption> options, uint64_t selectedIndex)
36+
LegibleMediaSelectionOptionsChanged(WebKit::PlaybackSessionContextIdentifier contextId, Vector<WebCore::MediaSelectionOption> options, uint64_t selectedIndex)
37+
AudioMediaSelectionIndexChanged(WebKit::PlaybackSessionContextIdentifier contextId, uint64_t selectedIndex)
38+
LegibleMediaSelectionIndexChanged(WebKit::PlaybackSessionContextIdentifier contextId, uint64_t selectedIndex)
39+
ExternalPlaybackPropertiesChanged(WebKit::PlaybackSessionContextIdentifier contextId, bool enabled, enum:uint8_t WebCore::PlaybackSessionModelExternalPlaybackTargetType targetType, String localizedDeviceName)
40+
WirelessVideoPlaybackDisabledChanged(WebKit::PlaybackSessionContextIdentifier contextId, bool disabled)
41+
DurationChanged(WebKit::PlaybackSessionContextIdentifier contextId, double duration)
42+
PlaybackStartedTimeChanged(WebKit::PlaybackSessionContextIdentifier contextId, double playbackStartedTime)
43+
RateChanged(WebKit::PlaybackSessionContextIdentifier contextId, OptionSet<WebCore::PlaybackSessionModelPlaybackState> playbackState, double rate, double defaultPlaybackRate)
44+
MutedChanged(WebKit::PlaybackSessionContextIdentifier contextId, bool muted);
45+
VolumeChanged(WebKit::PlaybackSessionContextIdentifier contextId, double volume);
46+
PictureInPictureSupportedChanged(WebKit::PlaybackSessionContextIdentifier contextId, bool pictureInPictureSupported)
47+
IsInWindowFullscreenActiveChanged(WebKit::PlaybackSessionContextIdentifier contextId, bool isInWindow)
4848
#if HAVE(PIP_SKIP_PREROLL)
49-
CanSkipAdChanged(WebCore::MediaPlayerClientIdentifier contextId, bool value)
49+
CanSkipAdChanged(WebKit::PlaybackSessionContextIdentifier contextId, bool value)
5050
#endif
5151
#if ENABLE(LINEAR_MEDIA_PLAYER)
52-
SupportsLinearMediaPlayerChanged(WebCore::MediaPlayerClientIdentifier contextId, bool supportsLinearMediaPlayer)
52+
SupportsLinearMediaPlayerChanged(WebKit::PlaybackSessionContextIdentifier contextId, bool supportsLinearMediaPlayer)
5353
#endif
54-
SpatialVideoMetadataChanged(WebCore::MediaPlayerClientIdentifier contextId, struct std::optional<WebCore::SpatialVideoMetadata> metadata);
55-
VideoProjectionMetadataChanged(WebCore::MediaPlayerClientIdentifier contextId, struct std::optional<WebCore::VideoProjectionMetadata> metadata);
56-
SetUpPlaybackControlsManagerWithID(WebCore::MediaPlayerClientIdentifier contextId, bool isVideo)
54+
SpatialVideoMetadataChanged(WebKit::PlaybackSessionContextIdentifier contextId, struct std::optional<WebCore::SpatialVideoMetadata> metadata);
55+
VideoProjectionMetadataChanged(WebKit::PlaybackSessionContextIdentifier contextId, struct std::optional<WebCore::VideoProjectionMetadata> metadata);
56+
SetUpPlaybackControlsManagerWithID(WebKit::PlaybackSessionContextIdentifier contextId, bool isVideo)
5757
ClearPlaybackControlsManager()
5858

59-
SwapFullscreenModes(WebCore::MediaPlayerClientIdentifier firstContextId, WebCore::MediaPlayerClientIdentifier secondContextId)
59+
SwapFullscreenModes(WebKit::PlaybackSessionContextIdentifier firstContextId, WebKit::PlaybackSessionContextIdentifier secondContextId)
6060

61-
HandleControlledElementIDResponse(WebCore::MediaPlayerClientIdentifier contextId, String id)
61+
HandleControlledElementIDResponse(WebKit::PlaybackSessionContextIdentifier contextId, String id)
6262

6363
#if !RELEASE_LOG_DISABLED
64-
SetLogIdentifier(WebCore::MediaPlayerClientIdentifier contextId, uint64_t logIdentifier)
64+
SetLogIdentifier(WebKit::PlaybackSessionContextIdentifier contextId, uint64_t logIdentifier)
6565
#endif
6666
}
6767
#endif

0 commit comments

Comments
 (0)