WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-207904-20200220072530.patch (text/plain), 61.89 KB, created by
Eric Carlson
on 2020-02-20 07:25:30 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eric Carlson
Created:
2020-02-20 07:25:30 PST
Size:
61.89 KB
patch
obsolete
>Subversion Revision: 256941 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index dc69149b0c41d1d69e1591cd57e4bd45450c067f..799c99f8fe9c88e1eaa4be0a123a51e1d9d95773 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,55 @@ >+2020-02-19 Eric Carlson <eric.carlson@apple.com> >+ >+ Support in-band metadata cues when loading media in the GPU Process >+ https://bugs.webkit.org/show_bug.cgi?id=207904 >+ <rdar://problem/59561647> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests, unskipped existing tests. >+ >+ * WebCore.xcodeproj/project.pbxproj: >+ * html/HTMLMediaElement.cpp: >+ (WebCore::HTMLMediaElement::selectMediaResource): >+ (WebCore::HTMLMediaElement::play): >+ (WebCore::HTMLMediaElement::mediaEngineWasUpdated): >+ (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): >+ * html/track/InbandDataTextTrack.cpp: >+ (WebCore::InbandDataTextTrack::addDataCue): >+ (WebCore::InbandDataTextTrack::findIncompleteCue): >+ (WebCore::InbandDataTextTrack::updateDataCue): >+ (WebCore::InbandDataTextTrack::removeDataCue): >+ (WebCore::InbandDataTextTrack::removeCue): >+ * html/track/InbandDataTextTrack.h: >+ * html/track/TextTrack.cpp: >+ (WebCore::TextTrack::addCue): >+ * html/track/TextTrack.h: >+ (WebCore::TextTrack::cuesInternal const): >+ * html/track/TextTrackCue.cpp: >+ (WebCore::TextTrackCue::cueIndex const): >+ * platform/SerializedPlatformDataCue.h: >+ (WebCore::SerializedPlatformDataCue::deserialize const): >+ (WebCore::SerializedPlatformDataCue::data const): >+ (WebCore::SerializedPlatformDataCue::isEqual const): >+ (WebCore::SerializedPlatformDataCue::platformType const): >+ (WebCore::SerializedPlatformDataCue::encodingRequiresPlatformData const): >+ (WebCore::SerializedPlatformDataCue::encodableValue const): >+ * platform/graphics/MediaPlayer.cpp: >+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: >+ (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): >+ * platform/mac/SerializedPlatformDataCueMac.h: >+ * platform/mac/SerializedPlatformDataCueMac.mm: >+ (WebCore::SerializedPlatformDataCue::create): >+ (WebCore::SerializedPlatformDataCueMac::SerializedPlatformDataCueMac): >+ (WebCore::SerializedPlatformDataCueMac::~SerializedPlatformDataCueMac): >+ (WebCore::SerializedPlatformDataCueMac::isEqual const): >+ (WebCore::toSerializedPlatformDataCueMac): >+ (WebCore::SerializedPlatformDataCueMac::allowedClassesForNativeValues): >+ (WebCore::SerializedPlatformDataCueMac::encodableValue const): >+ (WebCore::jsValueWithAVMetadataItemInContext): >+ (WebCore::NSDictionaryWithAVMetadataItem): >+ (WebCore::SerializedPlatformDataCueMac::create): Deleted. >+ > 2020-02-19 Youenn Fablet <youenn@apple.com> > > Remove PlatformMediaSession::characteristics() >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4327956727d6dec8ff9c7d8968ceeba0109ef3b1..d1ca6d431f5dfa7d0774112d1365a2f9dd0a65f8 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,48 @@ >+2020-02-19 Eric Carlson <eric.carlson@apple.com> >+ >+ Support in-band metadata cues when loading media in the GPU Process >+ https://bugs.webkit.org/show_bug.cgi?id=207904 >+ <rdar://problem/59561647> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: >+ * GPUProcess/media/RemoteTextTrackProxy.cpp: >+ (WebKit::RemoteTextTrackProxy::addDataCue): >+ (WebKit::RemoteTextTrackProxy::updateDataCue): >+ (WebKit::RemoteTextTrackProxy::removeDataCue): >+ * Shared/WebCoreArgumentCoders.cpp: >+ (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encode): >+ (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decode): >+ * Shared/WebCoreArgumentCoders.h: >+ * Shared/mac/WebCoreArgumentCodersMac.mm: >+ (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encodePlatformData): >+ (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decodePlatformData): >+ * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: >+ (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): >+ (WebKit::MediaPlayerPrivateRemote::setConfiguration): >+ (WebKit::MediaPlayerPrivateRemote::addDataCue): >+ (WebKit::MediaPlayerPrivateRemote::addDataCueWithType): >+ (WebKit::MediaPlayerPrivateRemote::updateDataCue): >+ (WebKit::MediaPlayerPrivateRemote::removeDataCue): >+ * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: >+ * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in: >+ * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: >+ (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): >+ * WebProcess/GPU/media/RemoteMediaPlayerManager.h: >+ * WebProcess/GPU/media/TextTrackPrivateRemote.cpp: >+ (WebKit::TextTrackPrivateRemote::addGenericCue): >+ (WebKit::TextTrackPrivateRemote::updateGenericCue): >+ (WebKit::TextTrackPrivateRemote::removeGenericCue): >+ (WebKit::TextTrackPrivateRemote::parseWebVTTFileHeader): >+ (WebKit::TextTrackPrivateRemote::parseWebVTTCueData): >+ (WebKit::TextTrackPrivateRemote::parseWebVTTCueDataStruct): >+ (WebKit::TextTrackPrivateRemote::addDataCue): >+ (WebKit::TextTrackPrivateRemote::addDataCueWithType): >+ (WebKit::TextTrackPrivateRemote::updateDataCue): >+ (WebKit::TextTrackPrivateRemote::removeDataCue): >+ * WebProcess/GPU/media/TextTrackPrivateRemote.h: >+ > 2020-02-19 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] fast/dom/focus-shift-crash.html and editing/selection/selection-change-in-disconnected-frame-crash.html crash after r256864 >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 2480f2a3f22ee0d374ac988060622f1adf2e725c..44bca20b7fe5668571ee828f9745d50e1f6de938 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -1764,6 +1764,7 @@ platform/ScrollableArea.cpp > platform/Scrollbar.cpp > platform/ScrollbarTheme.cpp > platform/ScrollbarThemeComposite.cpp >+platform/SerializedPlatformDataCue.cpp > platform/SharedBuffer.cpp > platform/SharedBufferChunkReader.cpp > platform/SharedStringHash.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 78c837a8c8495fd13bc9c71afeffff1ccee660f3..4d0c15150516bff411a61f9d379b0015d47251e4 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -135,10 +135,11 @@ > 07638A9A1884487200E15A1B /* MediaSessionManagerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07638A981884487200E15A1B /* MediaSessionManagerIOS.mm */; }; > 076970861463AD8700F502CF /* TextTrackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076970841463AD8700F502CF /* TextTrackList.cpp */; }; > 076970871463AD8700F502CF /* TextTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = 076970851463AD8700F502CF /* TextTrackList.h */; }; >+ 076D1C1F23F6EB5B00D95B06 /* SerializedPlatformDataCueValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 076D1C1D23F6D9D800D95B06 /* SerializedPlatformDataCueValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 076F0D0E12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */; }; > 077664FD183E6B5C00133B92 /* JSQuickTimePluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 077664FB183E6B5C00133B92 /* JSQuickTimePluginReplacement.h */; }; > 077AF14018F4AE400001ED61 /* SerializedPlatformDataCue.h in Headers */ = {isa = PBXBuildFile; fileRef = 077AF13E18F4AE400001ED61 /* SerializedPlatformDataCue.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 077AF14318F4B1BB0001ED61 /* SerializedPlatformDataCueMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 077AF14118F4B1BB0001ED61 /* SerializedPlatformDataCueMac.h */; }; >+ 077AF14318F4B1BB0001ED61 /* SerializedPlatformDataCueMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 077AF14118F4B1BB0001ED61 /* SerializedPlatformDataCueMac.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 077B64131B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 077B64111B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 077B64171B95F703003E9AD5 /* MediaPlaybackTargetMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 077B64151B95F703003E9AD5 /* MediaPlaybackTargetMock.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0783228518013ED800999E0C /* MediaStreamAudioSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 0783228318013ED800999E0C /* MediaStreamAudioSource.h */; }; >@@ -5473,6 +5474,7 @@ > 07638A981884487200E15A1B /* MediaSessionManagerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaSessionManagerIOS.mm; sourceTree = "<group>"; }; > 076970841463AD8700F502CF /* TextTrackList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextTrackList.cpp; sourceTree = "<group>"; }; > 076970851463AD8700F502CF /* TextTrackList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackList.h; sourceTree = "<group>"; }; >+ 076D1C1D23F6D9D800D95B06 /* SerializedPlatformDataCueValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SerializedPlatformDataCueValue.h; sourceTree = "<group>"; }; > 076E11BE1F683E0D00177395 /* TrackPrivateBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackPrivateBase.cpp; sourceTree = "<group>"; }; > 076F0D0912B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaPlayerPrivateAVFoundation.cpp; sourceTree = "<group>"; }; > 076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerPrivateAVFoundation.h; sourceTree = "<group>"; }; >@@ -5490,6 +5492,7 @@ > 07846340145B151A00A58DF1 /* JSTrackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTrackEvent.cpp; sourceTree = "<group>"; }; > 07846341145B151A00A58DF1 /* JSTrackEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTrackEvent.h; sourceTree = "<group>"; }; > 07846384145B1B8E00A58DF1 /* JSTrackCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTrackCustom.h; sourceTree = "<group>"; }; >+ 078633D723FE09640087AE21 /* SerializedPlatformDataCue.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SerializedPlatformDataCue.cpp; sourceTree = "<group>"; }; > 0787C4671BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaTrackSupportedConstraints.cpp; sourceTree = "<group>"; }; > 0787C4681BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaTrackSupportedConstraints.h; sourceTree = "<group>"; }; > 078E094817D1709600420AA1 /* MediaStreamAudioDestinationNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamAudioDestinationNode.cpp; sourceTree = "<group>"; }; >@@ -25994,7 +25997,9 @@ > BC2441C30E8B65D00055320F /* ScrollView.cpp */, > BC6D6E2509AF943500F59759 /* ScrollView.h */, > AB7170880B3118080017123E /* SearchPopupMenu.h */, >+ 078633D723FE09640087AE21 /* SerializedPlatformDataCue.cpp */, > 077AF13E18F4AE400001ED61 /* SerializedPlatformDataCue.h */, >+ 076D1C1D23F6D9D800D95B06 /* SerializedPlatformDataCueValue.h */, > 1A4A954B0B4EDCCB002D8C3C /* SharedBuffer.cpp */, > 1A4A954C0B4EDCCB002D8C3C /* SharedBuffer.h */, > 834DFACE1F7DAE5700C2725B /* SharedStringHash.cpp */, >@@ -32254,6 +32259,7 @@ > E18DF33518AAF12C00773E59 /* SerializedCryptoKeyWrap.h in Headers */, > 077AF14018F4AE400001ED61 /* SerializedPlatformDataCue.h in Headers */, > 077AF14318F4B1BB0001ED61 /* SerializedPlatformDataCueMac.h in Headers */, >+ 076D1C1F23F6EB5B00D95B06 /* SerializedPlatformDataCueValue.h in Headers */, > A75E497610752ACB00C9B896 /* SerializedScriptValue.h in Headers */, > 516F7F6D1C31E39A00F111DC /* ServerOpenDBRequest.h in Headers */, > 2D93AEE319DF5641002A86C3 /* ServicesOverlayController.h in Headers */, >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 04001b4ba9edfaebfeaf1f27cfa0fce447c11d88..0e868a0bae7bd22824adcb44eb68ae179bc91ccb 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -1332,7 +1332,7 @@ void HTMLMediaElement::selectMediaResource() > mode = Attribute; > ASSERT(m_player); > if (!m_player) { >- ERROR_LOG(logSiteIdentifier, " has srcAttr but m_player is not created"); >+ ERROR_LOG(logSiteIdentifier, "has srcAttr but m_player is not created"); > return; > } > } else if (auto firstSource = childrenOfType<HTMLSourceElement>(*this).first()) { >@@ -3473,11 +3473,13 @@ void HTMLMediaElement::play(DOMPromiseDeferred<void>&& promise) > if (!success) { > if (success.value() == MediaPlaybackDenialReason::UserGestureRequired) > setAutoplayEventPlaybackState(AutoplayEventPlaybackState::PreventedAutoplay); >+ ERROR_LOG(LOGIDENTIFIER, "rejecting promise: ", success.value()); > promise.reject(NotAllowedError); > return; > } > > if (m_error && m_error->code() == MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED) { >+ ERROR_LOG(LOGIDENTIFIER, "rejecting promise because of error"); > promise.reject(NotSupportedError, "The operation is not supported."); > return; > } >@@ -3495,6 +3497,7 @@ void HTMLMediaElement::play() > > auto success = m_mediaSession->playbackPermitted(); > if (!success) { >+ ERROR_LOG(LOGIDENTIFIER, "playback not permitted: ", success.value()); > if (success.value() == MediaPlaybackDenialReason::UserGestureRequired) > setAutoplayEventPlaybackState(AutoplayEventPlaybackState::PreventedAutoplay); > return; >@@ -5094,7 +5097,8 @@ void HTMLMediaElement::scheduleMediaEngineWasUpdated() > > void HTMLMediaElement::mediaEngineWasUpdated() > { >- INFO_LOG(LOGIDENTIFIER); >+ ALWAYS_LOG(LOGIDENTIFIER); >+ > beginProcessingMediaPlayerCallback(); > updateRenderer(); > endProcessingMediaPlayerCallback(); >@@ -5129,7 +5133,7 @@ void HTMLMediaElement::mediaEngineWasUpdated() > > void HTMLMediaElement::mediaPlayerEngineUpdated() > { >- INFO_LOG(LOGIDENTIFIER); >+ INFO_LOG(LOGIDENTIFIER, m_player->engineDescription()); > > #if ENABLE(MEDIA_SOURCE) > m_droppedVideoFrames = 0; >diff --git a/Source/WebCore/html/track/InbandDataTextTrack.cpp b/Source/WebCore/html/track/InbandDataTextTrack.cpp >index f07f738d28361cc4bfd492c64a84ac9bd4ca6504..0c04f3c1b5f172e72dcf3fa5e35bb0e973208651 100644 >--- a/Source/WebCore/html/track/InbandDataTextTrack.cpp >+++ b/Source/WebCore/html/track/InbandDataTextTrack.cpp >@@ -59,7 +59,7 @@ void InbandDataTextTrack::addDataCue(const MediaTime& start, const MediaTime& en > > void InbandDataTextTrack::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&& platformValue, const String& type) > { >- if (m_incompleteCueMap.contains(platformValue.ptr())) >+ if (findIncompleteCue(platformValue)) > return; > > auto cue = DataCue::create(*scriptExecutionContext(), start, end, platformValue.copyRef(), type); >@@ -70,7 +70,7 @@ void InbandDataTextTrack::addDataCue(const MediaTime& start, const MediaTime& en > > if (end.isPositiveInfinite() && mediaElement()) { > cue->setEndTime(mediaElement()->durationMediaTime()); >- m_incompleteCueMap.add(WTFMove(platformValue), cue.copyRef()); >+ m_incompleteCueMap.append(&cue.get()); > } > > INFO_LOG(LOGIDENTIFIER, cue.get()); >@@ -78,9 +78,21 @@ void InbandDataTextTrack::addDataCue(const MediaTime& start, const MediaTime& en > addCue(WTFMove(cue)); > } > >+RefPtr<DataCue> InbandDataTextTrack::findIncompleteCue(const SerializedPlatformDataCue& cueToFind) >+{ >+ auto index = m_incompleteCueMap.findMatching([&](const auto& cue) { >+ return cueToFind.isEqual(*cue->platformValue()); >+ }); >+ >+ if (index == notFound) >+ return nullptr; >+ >+ return m_incompleteCueMap[index]; >+} >+ > void InbandDataTextTrack::updateDataCue(const MediaTime& start, const MediaTime& inEnd, SerializedPlatformDataCue& platformValue) > { >- RefPtr<DataCue> cue = m_incompleteCueMap.get(&platformValue); >+ auto cue = findIncompleteCue(platformValue); > if (!cue) > return; > >@@ -90,7 +102,7 @@ void InbandDataTextTrack::updateDataCue(const MediaTime& start, const MediaTime& > if (end.isPositiveInfinite() && mediaElement()) > end = mediaElement()->durationMediaTime(); > else >- m_incompleteCueMap.remove(&platformValue); >+ m_incompleteCueMap.removeFirst(cue); > > INFO_LOG(LOGIDENTIFIER, "was start = ", cue->startMediaTime(), ", end = ", cue->endMediaTime(), ", will be start = ", start, ", end = ", end); > >@@ -102,8 +114,9 @@ void InbandDataTextTrack::updateDataCue(const MediaTime& start, const MediaTime& > > void InbandDataTextTrack::removeDataCue(const MediaTime&, const MediaTime&, SerializedPlatformDataCue& platformValue) > { >- if (auto cue = m_incompleteCueMap.take(&platformValue)) { >+ if (auto cue = findIncompleteCue(platformValue)) { > INFO_LOG(LOGIDENTIFIER, "removing: ", *cue); >+ m_incompleteCueMap.removeFirst(cue); > InbandTextTrack::removeCue(*cue); > } > } >@@ -112,7 +125,8 @@ ExceptionOr<void> InbandDataTextTrack::removeCue(TextTrackCue& cue) > { > ASSERT(cue.cueType() == TextTrackCue::Data); > >- m_incompleteCueMap.remove(const_cast<SerializedPlatformDataCue*>(toDataCue(&cue)->platformValue())); >+ if (auto platformValue = const_cast<SerializedPlatformDataCue*>(toDataCue(&cue)->platformValue())) >+ removeDataCue({ }, { }, *platformValue); > > return InbandTextTrack::removeCue(cue); > } >diff --git a/Source/WebCore/html/track/InbandDataTextTrack.h b/Source/WebCore/html/track/InbandDataTextTrack.h >index 1a8bdf6ae5228bef0cf8d1dad95e356f628a44f2..4fc313eacc517412304698f42e3caeea9d193958 100644 >--- a/Source/WebCore/html/track/InbandDataTextTrack.h >+++ b/Source/WebCore/html/track/InbandDataTextTrack.h >@@ -55,7 +55,9 @@ private: > void removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&) final; > ExceptionOr<void> removeCue(TextTrackCue&) final; > >- HashMap<RefPtr<SerializedPlatformDataCue>, RefPtr<DataCue>> m_incompleteCueMap; >+ RefPtr<DataCue> findIncompleteCue(const SerializedPlatformDataCue&); >+ >+ Vector<RefPtr<DataCue>> m_incompleteCueMap; > #endif > }; > >diff --git a/Source/WebCore/html/track/TextTrack.h b/Source/WebCore/html/track/TextTrack.h >index 47e6dee93d0692997360951e511238d9e30598f2..073652f444515e8d8a0cdeeb21c06c43677112e7 100644 >--- a/Source/WebCore/html/track/TextTrack.h >+++ b/Source/WebCore/html/track/TextTrack.h >@@ -96,6 +96,8 @@ public: > TextTrackCueList* cues(); > TextTrackCueList* activeCues() const; > >+ TextTrackCueList* cuesInternal() const { return m_cues.get(); } >+ > void clearClient() override { m_client = nullptr; } > TextTrackClient* client() { return m_client; } > >diff --git a/Source/WebCore/html/track/TextTrackCue.cpp b/Source/WebCore/html/track/TextTrackCue.cpp >index e5df3c3b7866ea9fd43daccf4a4622bdb6489422..cbdd8c031db7cfe0e845611976267f2451224efc 100644 >--- a/Source/WebCore/html/track/TextTrackCue.cpp >+++ b/Source/WebCore/html/track/TextTrackCue.cpp >@@ -341,11 +341,11 @@ void TextTrackCue::setIsActive(bool active) > > unsigned TextTrackCue::cueIndex() const > { >- ASSERT(m_track && m_track->cues()); >- if (!m_track || !m_track->cues()) >+ ASSERT(m_track && m_track->cuesInternal()); >+ if (!m_track || !m_track->cuesInternal()) > return std::numeric_limits<unsigned>::max(); > >- return m_track->cues()->cueIndex(*this); >+ return m_track->cuesInternal()->cueIndex(*this); > } > > bool TextTrackCue::isOrderedBefore(const TextTrackCue* other) const >diff --git a/Source/WebCore/platform/SerializedPlatformDataCue.cpp b/Source/WebCore/platform/SerializedPlatformDataCue.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..09bfb8a6a1e07c4eff4fa6ddd09e3e79a1e79e70 >--- /dev/null >+++ b/Source/WebCore/platform/SerializedPlatformDataCue.cpp >@@ -0,0 +1,42 @@ >+/* >+ * Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "SerializedPlatformDataCue.h" >+ >+#if ENABLE(VIDEO_TRACK) && ENABLE(DATACUE_VALUE) >+ >+namespace WebCore { >+ >+#if !PLATFORM(COCOA) >+Ref<SerializedPlatformDataCue> SerializedPlatformDataCue::create(SerializedPlatformDataCueValue&&) >+{ >+ return adoptRef(*new SerializedPlatformDataCue()); >+} >+#endif >+ >+} // namespace WebCore >+ >+#endif >diff --git a/Source/WebCore/platform/SerializedPlatformDataCue.h b/Source/WebCore/platform/SerializedPlatformDataCue.h >index 474ac1d4f7764b5cec13e17c6ee19a8b42d20077..08550fde7714a2ed5da0edb915567a2138f80ffc 100644 >--- a/Source/WebCore/platform/SerializedPlatformDataCue.h >+++ b/Source/WebCore/platform/SerializedPlatformDataCue.h >@@ -27,6 +27,7 @@ > > #if ENABLE(VIDEO) > >+#include "SerializedPlatformDataCueValue.h" > #include <JavaScriptCore/JSCInlines.h> > #include <wtf/RefCounted.h> > >@@ -34,16 +35,23 @@ namespace WebCore { > > class SerializedPlatformDataCue : public RefCounted<SerializedPlatformDataCue> { > public: >+ WEBCORE_EXPORT static Ref<SerializedPlatformDataCue> create(SerializedPlatformDataCueValue&&); >+ > virtual ~SerializedPlatformDataCue() = default; > >- virtual JSC::JSValue deserialize(JSC::JSGlobalObject*) const = 0; >- virtual RefPtr<JSC::ArrayBuffer> data() const = 0; >- virtual bool isEqual(const SerializedPlatformDataCue&) const = 0; >+ virtual JSC::JSValue deserialize(JSC::JSGlobalObject*) const { return JSC::jsNull(); } >+ virtual RefPtr<JSC::ArrayBuffer> data() const { return { }; } >+ virtual bool isEqual(const SerializedPlatformDataCue&) const { return false; } > >- enum PlatformType { >+ enum class PlatformType { >+ None, > ObjC, > }; >- virtual PlatformType platformType() const = 0; >+ virtual PlatformType platformType() const { return PlatformType::None; } >+ >+ virtual bool encodingRequiresPlatformData() const { return false; } >+ >+ virtual SerializedPlatformDataCueValue encodableValue() const { return { }; } > > protected: > SerializedPlatformDataCue() = default; >diff --git a/Source/WebCore/platform/SerializedPlatformDataCueValue.h b/Source/WebCore/platform/SerializedPlatformDataCueValue.h >new file mode 100644 >index 0000000000000000000000000000000000000000..4bc6334abe2b34c9f4aeb2a3ffcbbfc791c0adf0 >--- /dev/null >+++ b/Source/WebCore/platform/SerializedPlatformDataCueValue.h >@@ -0,0 +1,74 @@ >+/* >+ * Copyright (C) 2020 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(VIDEO) >+ >+#include <wtf/IsoMalloc.h> >+#include <wtf/RetainPtr.h> >+ >+#if !defined(__OBJC__) >+typedef struct objc_object *id; >+#endif >+ >+#if PLATFORM(COCOA) >+using PlatformNativeValue = id; >+#else >+using PlatformNativeValue = void*; >+#endif >+ >+namespace WebCore { >+ >+class SerializedPlatformDataCueValue { >+ WTF_MAKE_ISO_ALLOCATED(SerializedPlatformDataCueValue); >+public: >+ enum class PlatformType { >+ None, >+ ObjC, >+ }; >+ >+ SerializedPlatformDataCueValue(PlatformType platformType, PlatformNativeValue nativeValue) >+ : m_nativeValue(nativeValue) >+ , m_type(platformType) >+ { >+ } >+ SerializedPlatformDataCueValue() = default; >+ ~SerializedPlatformDataCueValue() = default; >+ >+ PlatformType platformType() const { return m_type; } >+ >+ PlatformNativeValue nativeValue() const { return m_nativeValue; } >+ >+ bool encodingRequiresPlatformData() const { return m_type == PlatformType::ObjC; } >+ >+protected: >+ PlatformNativeValue m_nativeValue { nullptr }; >+ PlatformType m_type { PlatformType::None }; >+}; >+ >+} // namespace WebCore >+ >+#endif >diff --git a/Source/WebCore/platform/graphics/MediaPlayer.cpp b/Source/WebCore/platform/graphics/MediaPlayer.cpp >index ca71e7e0b586c7b55b112732bad59b01d8a4181b..57dfcbf4bc7c48844d381cb35ecc643c1aab4b92 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayer.cpp >+++ b/Source/WebCore/platform/graphics/MediaPlayer.cpp >@@ -109,6 +109,8 @@ public: > void play() final { } > void pause() final { } > >+ String engineDescription() const final { return "NullMediaPlayer"; } >+ > PlatformLayer* platformLayer() const final { return nullptr; } > > FloatSize naturalSize() const final { return FloatSize(); } >diff --git a/Source/WebCore/platform/graphics/TrackPrivateBase.cpp b/Source/WebCore/platform/graphics/TrackPrivateBase.cpp >index fe1c064ae512772308cc2c4cb2243eb92e531800..b7864f7b370e33526756cda62d727ac07c80b637 100644 >--- a/Source/WebCore/platform/graphics/TrackPrivateBase.cpp >+++ b/Source/WebCore/platform/graphics/TrackPrivateBase.cpp >@@ -33,9 +33,10 @@ > > namespace WebCore { > >+#if !RELEASE_LOG_DISABLED >+ > static uint64_t s_uniqueId = 0; > >-#if !RELEASE_LOG_DISABLED > void TrackPrivateBase::setLogger(const Logger& logger, const void* logIdentifier) > { > m_logger = &logger; >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >index 820da89c46f87153296e1674df46a1d74be06f9a..b37c441131498879546ec8a57a0dd8e11f784697 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >@@ -3074,7 +3074,7 @@ void MediaPlayerPrivateAVFoundationObjC::metadataDidArrive(const RetainPtr<NSArr > if (item.keySpace) > type = metadataType(item.keySpace); > >- m_metadataTrack->addDataCue(start, end, SerializedPlatformDataCueMac::create(item), type); >+ m_metadataTrack->addDataCue(start, end, SerializedPlatformDataCue::create({ WebCore::SerializedPlatformDataCueValue::PlatformType::ObjC, item }), type); > } > #endif > } >diff --git a/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.h b/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.h >index a10dccc3e1b5a30dfbf010a7605052806b2196eb..26d84b9a892d6afc84ae93edbb2f0ab4bd06e3de 100644 >--- a/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.h >+++ b/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.h >@@ -29,28 +29,26 @@ > > #include "SerializedPlatformDataCue.h" > >-#if USE(FOUNDATION) && !defined(__OBJC__) >-typedef struct objc_object *id; >-#endif >- > namespace WebCore { > > class SerializedPlatformDataCueMac final : public SerializedPlatformDataCue { > public: >+ SerializedPlatformDataCueMac(SerializedPlatformDataCueValue&&); > virtual ~SerializedPlatformDataCueMac(); >- static Ref<SerializedPlatformDataCue> create(id); > > JSC::JSValue deserialize(JSC::JSGlobalObject*) const final; > RefPtr<ArrayBuffer> data() const final; >- > bool isEqual(const SerializedPlatformDataCue&) const final; >+ PlatformType platformType() const final { return PlatformType::ObjC; } >+ bool encodingRequiresPlatformData() const final { return true; } > >- PlatformType platformType() const final { return SerializedPlatformDataCue::ObjC; } >+ WEBCORE_EXPORT SerializedPlatformDataCueValue encodableValue() const final; > > id nativeValue() const { return m_nativeValue.get(); } > >+ WEBCORE_EXPORT static NSArray* allowedClassesForNativeValues(); >+ > private: >- explicit SerializedPlatformDataCueMac(id nativeValue); > > RetainPtr<id> m_nativeValue; > }; >diff --git a/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm b/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm >index b949eb7cdd20039f1cffef8c4c5bcd7b113eb199..c984a9eea7a959b64acc7f12d516072138c7ae26 100644 >--- a/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm >+++ b/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm >@@ -48,21 +48,23 @@ static JSValue *jsValueWithArrayInContext(NSArray *, JSContext *); > static JSValue *jsValueWithDictionaryInContext(NSDictionary *, JSContext *); > static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *, JSContext *); > static JSValue *jsValueWithValueInContext(id, JSContext *); >+static NSDictionary *NSDictionaryWithAVMetadataItem(AVMetadataItem *); > #endif > >-SerializedPlatformDataCueMac::SerializedPlatformDataCueMac(id nativeValue) >- : SerializedPlatformDataCue() >- , m_nativeValue(nativeValue) >+Ref<SerializedPlatformDataCue> SerializedPlatformDataCue::create(SerializedPlatformDataCueValue&& value) > { >+ return adoptRef(*new SerializedPlatformDataCueMac(WTFMove(value))); > } > >-SerializedPlatformDataCueMac::~SerializedPlatformDataCueMac() >+SerializedPlatformDataCueMac::SerializedPlatformDataCueMac(SerializedPlatformDataCueValue&& value) >+ : SerializedPlatformDataCue() >+ , m_nativeValue(value.nativeValue()) > { >+ RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(value.platformType() == SerializedPlatformDataCueValue::PlatformType::ObjC); > } > >-Ref<SerializedPlatformDataCue> SerializedPlatformDataCueMac::create(id nativeValue) >+SerializedPlatformDataCueMac::~SerializedPlatformDataCueMac() > { >- return adoptRef(*new SerializedPlatformDataCueMac(nativeValue)); > } > > RefPtr<ArrayBuffer> SerializedPlatformDataCueMac::data() const >@@ -89,7 +91,7 @@ JSC::JSValue SerializedPlatformDataCueMac::deserialize(JSC::JSGlobalObject* lexi > > bool SerializedPlatformDataCueMac::isEqual(const SerializedPlatformDataCue& other) const > { >- if (other.platformType() != SerializedPlatformDataCue::ObjC) >+ if (other.platformType() != PlatformType::ObjC) > return false; > > const SerializedPlatformDataCueMac* otherObjC = toSerializedPlatformDataCueMac(&other); >@@ -107,10 +109,24 @@ SerializedPlatformDataCueMac* toSerializedPlatformDataCueMac(SerializedPlatformD > > const SerializedPlatformDataCueMac* toSerializedPlatformDataCueMac(const SerializedPlatformDataCue* rep) > { >- RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(rep->platformType() == SerializedPlatformDataCue::ObjC); >+ RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(rep->platformType() == SerializedPlatformDataCue::PlatformType::ObjC); > return static_cast<const SerializedPlatformDataCueMac*>(rep); > } > >+NSArray* SerializedPlatformDataCueMac::allowedClassesForNativeValues() >+{ >+ static NeverDestroyed<RetainPtr<NSArray>> allowedClasses(@[ [NSString class], [NSNumber class], [NSLocale class], [NSDictionary class], [NSArray class], [NSData class] ]); >+ return allowedClasses.get().get(); >+} >+ >+SerializedPlatformDataCueValue SerializedPlatformDataCueMac::encodableValue() const >+{ >+ if ([m_nativeValue.get() isKindOfClass:PAL::getAVMetadataItemClass()]) >+ return { SerializedPlatformDataCueValue::PlatformType::ObjC, NSDictionaryWithAVMetadataItem(m_nativeValue.get()) }; >+ >+ return { SerializedPlatformDataCueValue::PlatformType::ObjC, m_nativeValue.get() }; >+} >+ > #if JSC_OBJC_API_ENABLED > static JSValue *jsValueWithValueInContext(id value, JSContext *context) > { >@@ -193,6 +209,11 @@ static JSValue *jsValueWithDictionaryInContext(NSDictionary *dictionary, JSConte > } > > static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *item, JSContext *context) >+{ >+ return jsValueWithDictionaryInContext(NSDictionaryWithAVMetadataItem(item), context); >+} >+ >+static NSDictionary *NSDictionaryWithAVMetadataItem(AVMetadataItem *item) > { > NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; > >@@ -230,7 +251,7 @@ static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *item, JSConte > if (item.value) > [dictionary setObject:item.value forKey:@"data"]; > >- return jsValueWithDictionaryInContext(dictionary, context); >+ return dictionary; > } > #endif > >diff --git a/Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in b/Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in >index 64f3cbf20c52c36206aaeb9c4997a72f5be40f87..4cbd4614b62b8c3e7d4f56ca950c94476129932f 100644 >--- a/Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in >+++ b/Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in >@@ -24,8 +24,8 @@ > #if ENABLE(GPU_PROCESS) > > messages -> RemoteMediaPlayerManagerProxy NotRefCounted { >- CreateMediaPlayer(WebKit::MediaPlayerPrivateRemoteIdentifier id, enum:uint8_t WebCore::MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier, struct WebKit::RemoteMediaPlayerProxyConfiguration proxyConfiguration) -> (struct WebKit::RemoteMediaPlayerConfiguration playerConfiguration) Synchronous >- DeleteMediaPlayer(WebKit::MediaPlayerPrivateRemoteIdentifier id) >+ CreateMediaPlayer(WebKit::MediaPlayerPrivateRemoteIdentifier id, enum:uint8_t WebCore::MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier, struct WebKit::RemoteMediaPlayerProxyConfiguration proxyConfiguration) -> (struct WebKit::RemoteMediaPlayerConfiguration playerConfiguration) Async >+ DeleteMediaPlayer(WebKit::MediaPlayerPrivateRemoteIdentifier id) > > GetSupportedTypes(enum:uint8_t WebCore::MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier) -> (Vector<String> types) Synchronous > SupportsTypeAndCodecs(enum:uint8_t WebCore::MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier, struct WebCore::MediaEngineSupportParameters type) -> (enum:uint8_t WebCore::MediaPlayerEnums::SupportsType support) Synchronous >diff --git a/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp b/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp >index b76dc9b0d46f86b77957d3b3b785459c3949b2a6..32c9b7e12e5a72cb0bbbd0a95e03118e07240bc1 100644 >--- a/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp >+++ b/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp >@@ -96,25 +96,25 @@ void RemoteTextTrackProxy::languageChanged(const AtomString&) > configurationChanged(); > } > >-void RemoteTextTrackProxy::addDataCue(const MediaTime&, const MediaTime&, const void*, unsigned) >+void RemoteTextTrackProxy::addDataCue(const MediaTime& start, const MediaTime& end, const void* data, unsigned length) > { >- notImplemented(); >+ m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::AddDataCue(m_identifier, start, end, IPC::DataReference(reinterpret_cast<const uint8_t*>(data), length)), m_player.idendifier()); > } > > #if ENABLE(DATACUE_VALUE) >-void RemoteTextTrackProxy::addDataCue(const MediaTime&, const MediaTime&, Ref<SerializedPlatformDataCue>&&, const String&) >+void RemoteTextTrackProxy::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&& cueData, const String& type) > { >- notImplemented(); >+ m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::AddDataCueWithType(m_identifier, start, end, cueData->encodableValue(), type), m_player.idendifier()); > } > >-void RemoteTextTrackProxy::updateDataCue(const MediaTime&, const MediaTime&, SerializedPlatformDataCue&) >+void RemoteTextTrackProxy::updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue& cueData) > { >- notImplemented(); >+ m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::UpdateDataCue(m_identifier, start, end, cueData.encodableValue()), m_player.idendifier()); > } > >-void RemoteTextTrackProxy::removeDataCue(const MediaTime&, const MediaTime&, SerializedPlatformDataCue&) >+void RemoteTextTrackProxy::removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue& cueData) > { >- notImplemented(); >+ m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::RemoveDataCue(m_identifier, start, end, cueData.encodableValue()), m_player.idendifier()); > } > #endif > >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >index 1c00bda53f5b6b434ea71979f4e6321381da572c..8c9fa21af38a7162c6c209e939468906a25c3ca3 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >@@ -75,6 +75,7 @@ > #include <WebCore/SearchPopupMenu.h> > #include <WebCore/SecurityOrigin.h> > #include <WebCore/SerializedAttachmentData.h> >+#include <WebCore/SerializedPlatformDataCueValue.h> > #include <WebCore/ServiceWorkerClientData.h> > #include <WebCore/ServiceWorkerClientIdentifier.h> > #include <WebCore/ServiceWorkerData.h> >@@ -3174,4 +3175,32 @@ Optional<SerializedAttachmentData> ArgumentCoder<WebCore::SerializedAttachmentDa > > #endif // ENABLE(ATTACHMENT_ELEMENT) > >+#if ENABLE(VIDEO) >+void ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encode(Encoder& encoder, const SerializedPlatformDataCueValue& value) >+{ >+ bool hasPlatformData = value.encodingRequiresPlatformData(); >+ encoder << hasPlatformData; >+ >+ encoder.encodeEnum(value.platformType()); >+ if (hasPlatformData) >+ encodePlatformData(encoder, value); >+} >+ >+Optional<SerializedPlatformDataCueValue> ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decode(IPC::Decoder& decoder) >+{ >+ bool hasPlatformData; >+ if (!decoder.decode(hasPlatformData)) >+ return WTF::nullopt; >+ >+ WebCore::SerializedPlatformDataCueValue::PlatformType type; >+ if (!decoder.decodeEnum(type)) >+ return WTF::nullopt; >+ >+ if (hasPlatformData) >+ return decodePlatformData(decoder, type); >+ >+ return {{ }}; >+} >+#endif >+ > } // namespace IPC >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.h b/Source/WebKit/Shared/WebCoreArgumentCoders.h >index 7bf71c17abdd3d8b13190220058c9f9c219f60b3..e3814e21f8336aaf2f4443232e344e0074dae2a1 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.h >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.h >@@ -37,6 +37,7 @@ > #include <WebCore/NotificationDirection.h> > #include <WebCore/RealtimeMediaSource.h> > #include <WebCore/ScrollSnapOffsetsInfo.h> >+#include <WebCore/SerializedPlatformDataCueValue.h> > #include <WebCore/ServiceWorkerTypes.h> > #include <WebCore/StoredCredentialsPolicy.h> > #include <WebCore/WorkerType.h> >@@ -819,6 +820,15 @@ template<> struct ArgumentCoder<WebCore::SerializedAttachmentData> { > > #endif // ENABLE(ATTACHMENT_ELEMENT) > >+#if ENABLE(VIDEO) >+template<> struct ArgumentCoder<WebCore::SerializedPlatformDataCueValue> { >+ static void encode(Encoder&, const WebCore::SerializedPlatformDataCueValue&); >+ static Optional<WebCore::SerializedPlatformDataCueValue> decode(Decoder&); >+ static void encodePlatformData(Encoder&, const WebCore::SerializedPlatformDataCueValue&); >+ static Optional<WebCore::SerializedPlatformDataCueValue> decodePlatformData(Decoder&, WebCore::SerializedPlatformDataCueValue::PlatformType); >+}; >+#endif >+ > } // namespace IPC > > namespace WTF { >diff --git a/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm b/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm >index ee222423f047c9bf093639d812b182d836180efe..8da7c1987792b87749a6ead7e993f96c7e181e1b 100644 >--- a/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm >+++ b/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm >@@ -37,6 +37,7 @@ > #import <WebCore/ProtectionSpace.h> > #import <WebCore/ResourceError.h> > #import <WebCore/ResourceRequest.h> >+#import <WebCore/SerializedPlatformDataCueMac.h> > #import <pal/spi/cf/CFNetworkSPI.h> > #import <wtf/MachSendRight.h> > >@@ -669,4 +670,27 @@ bool ArgumentCoder<WebCore::MediaPlaybackTargetContext>::decodePlatformData(Deco > > #endif > >+#if ENABLE(VIDEO) >+void ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encodePlatformData(Encoder& encoder, const WebCore::SerializedPlatformDataCueValue& value) >+{ >+ ASSERT(value.platformType() == WebCore::SerializedPlatformDataCueValue::PlatformType::ObjC); >+ if (value.platformType() == WebCore::SerializedPlatformDataCueValue::PlatformType::ObjC) >+ encodeObject(encoder, value.nativeValue()); >+} >+ >+Optional<WebCore::SerializedPlatformDataCueValue> ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decodePlatformData(Decoder& decoder, WebCore::SerializedPlatformDataCueValue::PlatformType platformType) >+{ >+ ASSERT(platformType == WebCore::SerializedPlatformDataCueValue::PlatformType::ObjC); >+ >+ if (platformType != WebCore::SerializedPlatformDataCueValue::PlatformType::ObjC) >+ return WTF::nullopt; >+ >+ auto object = decodeObject(decoder, WebCore::SerializedPlatformDataCueMac::allowedClassesForNativeValues()); >+ if (!object) >+ return WTF::nullopt; >+ >+ return WebCore::SerializedPlatformDataCueValue { platformType, object.value().get() }; >+} >+#endif >+ > } // namespace IPC >diff --git a/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp b/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp >index 9dc0ebb60664897f82db7e051808f0e489dc5279..a60bb4f9cd231d919038242142e3b0ee98e37bdb 100644 >--- a/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp >+++ b/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp >@@ -67,13 +67,12 @@ using namespace WebCore; > } while (0) > #endif > >-MediaPlayerPrivateRemote::MediaPlayerPrivateRemote(MediaPlayer* player, MediaPlayerEnums::MediaEngineIdentifier engineIdentifier, MediaPlayerPrivateRemoteIdentifier playerIdentifier, RemoteMediaPlayerManager& manager, const RemoteMediaPlayerConfiguration& configuration) >+MediaPlayerPrivateRemote::MediaPlayerPrivateRemote(MediaPlayer* player, MediaPlayerEnums::MediaEngineIdentifier engineIdentifier, MediaPlayerPrivateRemoteIdentifier playerIdentifier, RemoteMediaPlayerManager& manager) > : m_player(player) > , m_mediaResourceLoader(player->createResourceLoader()) > , m_manager(manager) > , m_remoteEngineIdentifier(engineIdentifier) > , m_id(playerIdentifier) >- , m_configuration(configuration) > #if !RELEASE_LOG_DISABLED > , m_logger(&player->mediaPlayerLogger()) > , m_logIdentifier(player->mediaPlayerLogIdentifier()) >@@ -82,6 +81,12 @@ MediaPlayerPrivateRemote::MediaPlayerPrivateRemote(MediaPlayer* player, MediaPla > INFO_LOG(LOGIDENTIFIER); > } > >+void MediaPlayerPrivateRemote::setConfiguration(RemoteMediaPlayerConfiguration&& configuration) >+{ >+ m_configuration = WTFMove(configuration); >+ m_player->mediaEngineUpdated(); >+} >+ > MediaPlayerPrivateRemote::~MediaPlayerPrivateRemote() > { > INFO_LOG(LOGIDENTIFIER); >@@ -484,6 +489,40 @@ void MediaPlayerPrivateRemote::parseWebVTTCueDataStruct(TrackPrivateRemoteIdenti > track->parseWebVTTCueDataStruct(WTFMove(data)); > } > >+void MediaPlayerPrivateRemote::addDataCue(TrackPrivateRemoteIdentifier identifier, MediaTime&& start, MediaTime&& end, IPC::DataReference&& data) >+{ >+ ASSERT(m_textTracks.contains(identifier)); >+ >+ if (const auto& track = m_textTracks.get(identifier)) >+ track->addDataCue(WTFMove(start), WTFMove(end), WTFMove(data)); >+} >+ >+#if ENABLE(DATACUE_VALUE) >+void MediaPlayerPrivateRemote::addDataCueWithType(TrackPrivateRemoteIdentifier identifier, MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&& data, String&& type) >+{ >+ ASSERT(m_textTracks.contains(identifier)); >+ >+ if (const auto& track = m_textTracks.get(identifier)) >+ track->addDataCueWithType(WTFMove(start), WTFMove(end), WTFMove(data), WTFMove(type)); >+} >+ >+void MediaPlayerPrivateRemote::updateDataCue(TrackPrivateRemoteIdentifier identifier, MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&& data) >+{ >+ ASSERT(m_textTracks.contains(identifier)); >+ >+ if (const auto& track = m_textTracks.get(identifier)) >+ track->updateDataCue(WTFMove(start), WTFMove(end), WTFMove(data)); >+} >+ >+void MediaPlayerPrivateRemote::removeDataCue(TrackPrivateRemoteIdentifier identifier, MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&& data) >+{ >+ ASSERT(m_textTracks.contains(identifier)); >+ >+ if (const auto& track = m_textTracks.get(identifier)) >+ track->removeDataCue(WTFMove(start), WTFMove(end), WTFMove(data)); >+} >+#endif >+ > void MediaPlayerPrivateRemote::addRemoteVideoTrack(TrackPrivateRemoteIdentifier identifier, TrackPrivateRemoteConfiguration&& configuration) > { > auto addResult = m_videoTracks.ensure(identifier, [&] { >diff --git a/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h b/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h >index 7f739041937e11f4ad025a1830e5cf3c89500da8..8b0ce39c50335f6241c0e9284ff93014de10be81 100644 >--- a/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h >+++ b/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h >@@ -40,12 +40,14 @@ > > namespace WebCore { > class ISOWebVTTCue; >+class SerializedPlatformDataCueValue; > } > > namespace WebKit { > > class AudioTrackPrivateRemote; > class TextTrackPrivateRemote; >+class UserData; > class VideoTrackPrivateRemote; > struct TextTrackPrivateRemoteConfiguration; > struct TrackPrivateRemoteConfiguration; >@@ -59,14 +61,16 @@ class MediaPlayerPrivateRemote final > #endif > { > public: >- static std::unique_ptr<MediaPlayerPrivateRemote> create(WebCore::MediaPlayer* player, WebCore::MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier, MediaPlayerPrivateRemoteIdentifier identifier, RemoteMediaPlayerManager& manager, const RemoteMediaPlayerConfiguration& configuration) >+ static std::unique_ptr<MediaPlayerPrivateRemote> create(WebCore::MediaPlayer* player, WebCore::MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier, MediaPlayerPrivateRemoteIdentifier identifier, RemoteMediaPlayerManager& manager) > { >- return makeUnique<MediaPlayerPrivateRemote>(player, remoteEngineIdentifier, identifier, manager, configuration); >+ return makeUnique<MediaPlayerPrivateRemote>(player, remoteEngineIdentifier, identifier, manager); > } > >- MediaPlayerPrivateRemote(WebCore::MediaPlayer*, WebCore::MediaPlayerEnums::MediaEngineIdentifier, MediaPlayerPrivateRemoteIdentifier, RemoteMediaPlayerManager&, const RemoteMediaPlayerConfiguration&); >+ MediaPlayerPrivateRemote(WebCore::MediaPlayer*, WebCore::MediaPlayerEnums::MediaEngineIdentifier, MediaPlayerPrivateRemoteIdentifier, RemoteMediaPlayerManager&); > ~MediaPlayerPrivateRemote(); > >+ void setConfiguration(RemoteMediaPlayerConfiguration&&); >+ > void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final; > > void invalidate() { m_invalid = true; } >@@ -104,6 +108,13 @@ public: > void parseWebVTTCueData(TrackPrivateRemoteIdentifier, IPC::DataReference&&); > void parseWebVTTCueDataStruct(TrackPrivateRemoteIdentifier, WebCore::ISOWebVTTCue&&); > >+ void addDataCue(TrackPrivateRemoteIdentifier, MediaTime&& start, MediaTime&& end, IPC::DataReference&&); >+#if ENABLE(DATACUE_VALUE) >+ void addDataCueWithType(TrackPrivateRemoteIdentifier, MediaTime&& start, MediaTime&& end, WebCore::SerializedPlatformDataCueValue&&, String&&); >+ void updateDataCue(TrackPrivateRemoteIdentifier, MediaTime&& start, MediaTime&& end, WebCore::SerializedPlatformDataCueValue&&); >+ void removeDataCue(TrackPrivateRemoteIdentifier, MediaTime&& start, MediaTime&& end, WebCore::SerializedPlatformDataCueValue&&); >+#endif >+ > void requestResource(RemoteMediaResourceIdentifier, WebCore::ResourceRequest&&, WebCore::PlatformMediaResourceLoader::LoadOptions, CompletionHandler<void()>&&); > void removeResource(RemoteMediaResourceIdentifier); > void resourceNotSupported(); >diff --git a/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in b/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in >index c404dc6740737a368d4fa6942a8e96097784607b..e8897b6a10a10d4b7009298c7aa2728bfe11297a 100644 >--- a/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in >+++ b/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in >@@ -50,10 +50,12 @@ messages -> MediaPlayerPrivateRemote NotRefCounted { > ParseWebVTTCueData(WebKit::TrackPrivateRemoteIdentifier trackID, IPC::DataReference data) > ParseWebVTTCueDataStruct(WebKit::TrackPrivateRemoteIdentifier trackID, WebCore::ISOWebVTTCue cueData) > >- ## AddDataCue(MediaTime start, MediaTime end, IPC::DataReference data) >- ## AddDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformDataCue data, String type) >- ## UpdateDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformDataCue data) >- ## RemoveDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformDataCue data) >+ AddDataCue(WebKit::TrackPrivateRemoteIdentifier trackID, MediaTime start, MediaTime end, IPC::DataReference data) >+#if ENABLE(DATACUE_VALUE) >+ AddDataCueWithType(WebKit::TrackPrivateRemoteIdentifier trackID, MediaTime start, MediaTime end, WebCore::SerializedPlatformDataCueValue cueData, String type) >+ UpdateDataCue(WebKit::TrackPrivateRemoteIdentifier trackID, MediaTime start, MediaTime end, WebCore::SerializedPlatformDataCueValue cueData) >+ RemoveDataCue(WebKit::TrackPrivateRemoteIdentifier trackID, MediaTime start, MediaTime end, WebCore::SerializedPlatformDataCueValue cueData) >+#endif > > ## AddGenericCue(WebCore::GenericCueData cue) > ## UpdateGenericCue(WebCore::GenericCueData cue) >diff --git a/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp b/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp >index 8f053768378eb05ced321ffcf11923b59eefc32b..38a53a0cbcff89d45ebcd41e7e6c3583bd27d3aa 100644 >--- a/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp >+++ b/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp >@@ -144,7 +144,6 @@ void RemoteMediaPlayerManager::initialize(const WebProcessCreationParameters& pa > > std::unique_ptr<MediaPlayerPrivateInterface> RemoteMediaPlayerManager::createRemoteMediaPlayer(MediaPlayer* player, MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier) > { >- auto id = MediaPlayerPrivateRemoteIdentifier::generate(); > > RemoteMediaPlayerProxyConfiguration proxyConfiguration; > proxyConfiguration.referrer = player->referrer(); >@@ -159,15 +158,19 @@ std::unique_ptr<MediaPlayerPrivateInterface> RemoteMediaPlayerManager::createRem > proxyConfiguration.shouldUsePersistentCache = player->shouldUsePersistentCache(); > proxyConfiguration.isVideo = player->isVideoPlayer(); > >+ auto identifier = MediaPlayerPrivateRemoteIdentifier::generate(); > RemoteMediaPlayerConfiguration playerConfiguration; >- bool sendSucceeded = gpuProcessConnection().connection().sendSync(Messages::RemoteMediaPlayerManagerProxy::CreateMediaPlayer(id, remoteEngineIdentifier, proxyConfiguration), Messages::RemoteMediaPlayerManagerProxy::CreateMediaPlayer::Reply(playerConfiguration), 0); >- if (!sendSucceeded) { >- WTFLogAlways("Failed to create remote media player."); >- return nullptr; >- } >+ gpuProcessConnection().connection().sendWithAsyncReply(Messages::RemoteMediaPlayerManagerProxy::CreateMediaPlayer(identifier, remoteEngineIdentifier, proxyConfiguration), [this, weakThis = makeWeakPtr(this), identifier](auto&& playerConfiguration) { >+ if (!weakThis) >+ return; >+ >+ if (const auto& player = m_players.get(identifier)) >+ player->setConfiguration(WTFMove(playerConfiguration)); >+ }, 0); >+ >+ auto remotePlayer = MediaPlayerPrivateRemote::create(player, remoteEngineIdentifier, identifier, *this); >+ m_players.add(identifier, makeWeakPtr(*remotePlayer)); > >- auto remotePlayer = MediaPlayerPrivateRemote::create(player, remoteEngineIdentifier, id, *this, playerConfiguration); >- m_players.add(id, makeWeakPtr(*remotePlayer)); > return remotePlayer; > } > >diff --git a/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.h b/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.h >index b266b3984c380cd3648221435d3f84fe1b5aa775..320ec30189d6fc562f2aebff51c90f74edf8da01 100644 >--- a/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.h >+++ b/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.h >@@ -51,7 +51,8 @@ class WebProcess; > struct TrackPrivateRemoteConfiguration; > > class RemoteMediaPlayerManager >- : public WebProcessSupplement { >+ : public WebProcessSupplement >+ , public CanMakeWeakPtr<RemoteMediaPlayerManager> { > WTF_MAKE_FAST_ALLOCATED; > public: > explicit RemoteMediaPlayerManager(WebProcess&); >diff --git a/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp b/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp >index 5c78764e0c17410cb23768a4515bd420458343f1..6a6622a395499007106bd490971105d58b83a96e 100644 >--- a/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp >+++ b/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp >@@ -88,66 +88,72 @@ void TextTrackPrivateRemote::updateConfiguration(TextTrackPrivateRemoteConfigura > m_isDefault = configuration.isDefault; > } > >-void TextTrackPrivateRemote::addDataCue(const MediaTime& start, const MediaTime& end, const void*, unsigned) >+void TextTrackPrivateRemote::addGenericCue(GenericCueData&) > { > notImplemented(); > } > >-#if ENABLE(DATACUE_VALUE) >-void TextTrackPrivateRemote::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&&, const String&) >+void TextTrackPrivateRemote::updateGenericCue(GenericCueData&) > { > notImplemented(); > } > >-void TextTrackPrivateRemote::updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&) >+void TextTrackPrivateRemote::removeGenericCue(GenericCueData&) > { > notImplemented(); > } > >-void TextTrackPrivateRemote::removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&) >+ >+void TextTrackPrivateRemote::parseWebVTTFileHeader(String&& header) > { >- notImplemented(); >+ ASSERT(client()); >+ if (auto* client = this->client()) >+ client->parseWebVTTFileHeader(WTFMove(header)); > } > >-#endif >- >-void TextTrackPrivateRemote::addGenericCue(GenericCueData&) >+void TextTrackPrivateRemote::parseWebVTTCueData(const IPC::DataReference& data) > { >- notImplemented(); >+ ASSERT(client()); >+ if (auto* client = this->client()) >+ client->parseWebVTTCueData(reinterpret_cast<const char*>(data.data()), data.size()); > } > >-void TextTrackPrivateRemote::updateGenericCue(GenericCueData&) >+void TextTrackPrivateRemote::parseWebVTTCueDataStruct(ISOWebVTTCue&& cueData) > { >- notImplemented(); >+ ASSERT(client()); >+ if (auto* client = this->client()) >+ client->parseWebVTTCueData(WTFMove(cueData)); > } > >-void TextTrackPrivateRemote::removeGenericCue(GenericCueData&) >+void TextTrackPrivateRemote::addDataCue(MediaTime&& start, MediaTime&& end, IPC::DataReference&& data) > { >- notImplemented(); >+ ASSERT(client()); >+ if (auto* client = this->client()) >+ client->addDataCue(WTFMove(start), WTFMove(end), reinterpret_cast<const char*>(data.data()), data.size()); > } > >- >-void TextTrackPrivateRemote::parseWebVTTFileHeader(String&& header) >+#if ENABLE(DATACUE_VALUE) >+void TextTrackPrivateRemote::addDataCueWithType(MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&& dataValue, String&& type) > { > ASSERT(client()); > if (auto* client = this->client()) >- client->parseWebVTTFileHeader(WTFMove(header)); >+ client->addDataCue(WTFMove(start), WTFMove(end), SerializedPlatformDataCue::create(WTFMove(dataValue)), type); > } > >-void TextTrackPrivateRemote::parseWebVTTCueData(const IPC::DataReference& data) >+void TextTrackPrivateRemote::updateDataCue(MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&& dataValue) > { > ASSERT(client()); > if (auto* client = this->client()) >- client->parseWebVTTCueData(reinterpret_cast<const char*>(data.data()), data.size()); >+ client->updateDataCue(WTFMove(start), WTFMove(end), SerializedPlatformDataCue::create(WTFMove(dataValue))); > } > >-void TextTrackPrivateRemote::parseWebVTTCueDataStruct(ISOWebVTTCue&& cueData) >+void TextTrackPrivateRemote::removeDataCue(MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&& dataValue) > { > ASSERT(client()); > if (auto* client = this->client()) >- client->parseWebVTTCueData(WTFMove(cueData)); >+ client->removeDataCue(WTFMove(start), WTFMove(end), SerializedPlatformDataCue::create(WTFMove(dataValue))); > } >- >+#endif > > } // namespace WebKit > >diff --git a/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h b/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h >index 6ac9c69d01920d9c94132b883e56f65bd8ec3ccc..7b7f703cb497dedea391db59cc92bece15a592e3 100644 >--- a/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h >+++ b/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h >@@ -32,6 +32,11 @@ > #include "TrackPrivateRemoteIdentifier.h" > #include <WebCore/InbandTextTrackPrivate.h> > >+namespace WebCore { >+class GenericCueData; >+class ISOWebVTTCue; >+} >+ > namespace WebKit { > > class MediaPlayerPrivateRemote; >@@ -44,21 +49,21 @@ public: > return adoptRef(*new TextTrackPrivateRemote(player, idendifier, WTFMove(configuration))); > } > >- void addDataCue(const MediaTime& start, const MediaTime& end, const void*, unsigned); >+ void addDataCue(MediaTime&& start, MediaTime&& end, IPC::DataReference&&); > > #if ENABLE(DATACUE_VALUE) >- void addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&&, const String&); >- void updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&); >- void removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&); >+ void addDataCueWithType(MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&&, String&&); >+ void updateDataCue(MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&&); >+ void removeDataCue(MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&&); > #endif > >- void addGenericCue(GenericCueData&); >- void updateGenericCue(GenericCueData&); >- void removeGenericCue(GenericCueData&); >+ void addGenericCue(WebCore::GenericCueData&); >+ void updateGenericCue(WebCore::GenericCueData&); >+ void removeGenericCue(WebCore::GenericCueData&); > > void parseWebVTTFileHeader(String&&); > void parseWebVTTCueData(const IPC::DataReference&); >- void parseWebVTTCueDataStruct(ISOWebVTTCue&&); >+ void parseWebVTTCueDataStruct(WebCore::ISOWebVTTCue&&); > > void updateConfiguration(TextTrackPrivateRemoteConfiguration&&); > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 5b32e9d309946c5ebb59bc28c235568b42d12615..5659e0950a3337e003a61aee2655bad4dacd2d5f 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2020-02-19 Eric Carlson <eric.carlson@apple.com> >+ >+ Support in-band metadata cues when loading media in the GPU Process >+ https://bugs.webkit.org/show_bug.cgi?id=207904 >+ <rdar://problem/59561647> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * gpu-process/TestExpectations: >+ > 2020-02-19 Jason Lawrence <lawrence.j@apple.com> > > [ Mac wk2 ] http/tests/inspector/network/har/har-page.html is flaky failing >diff --git a/LayoutTests/gpu-process/TestExpectations b/LayoutTests/gpu-process/TestExpectations >index b2402b949a9f7c761c97d9d22fb6c125418c4a94..913a5d44842fab9ce4734bddf37c4eae5d2075e8 100644 >--- a/LayoutTests/gpu-process/TestExpectations >+++ b/LayoutTests/gpu-process/TestExpectations >@@ -229,6 +229,8 @@ media/track/track-in-band.html [ Pass ] > http/tests/media/track/track-webvtt-slow-loading.html [ Pass ] > http/tests/media/track/track-webvtt-slow-loading-2.html [ Pass ] > http/tests/media/hls/hls-webvtt-tracks.html [ Pass ] >+http/tests/media/track-in-band-hls-metadata.html [ Pass ] >+http/tests/media/track-in-band-hls-metadata-crash.html [ Pass ] > > accessibility/media-element.html [ Skip ] > fast/block/float/list-marker-is-float-crash.html [ Skip ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 207904
:
391199
|
391243
|
391245
|
391282
|
391284
|
391285
|
391292
|
391300
|
391319
|
391331
|
391366