Diff
Modified: trunk/Source/WebCore/ChangeLog (256535 => 256536)
--- trunk/Source/WebCore/ChangeLog 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/ChangeLog 2020-02-13 21:40:08 UTC (rev 256536)
@@ -1,3 +1,49 @@
+2020-02-13 Eric Carlson <[email protected]>
+
+ Rename SerializedPlatformRepresentation to SerializedPlatformDataCue
+ https://bugs.webkit.org/show_bug.cgi?id=207695
+ <rdar://problem/59422673>
+
+ Reviewed by Youenn Fablet.
+
+ No new tests, no functional change.
+
+ * SourcesCocoa.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/track/DataCue.cpp:
+ (WebCore::DataCue::DataCue):
+ (WebCore::DataCue::cueContentsMatch const):
+ * html/track/DataCue.h:
+ * html/track/InbandDataTextTrack.cpp:
+ (WebCore::InbandDataTextTrack::addDataCue):
+ (WebCore::InbandDataTextTrack::updateDataCue):
+ (WebCore::InbandDataTextTrack::removeDataCue):
+ (WebCore::InbandDataTextTrack::removeCue):
+ * html/track/InbandDataTextTrack.h:
+ * html/track/InbandTextTrack.h:
+ * platform/SerializedPlatformDataCue.h: Renamed from Source/WebCore/platform/SerializedPlatformRepresentation.h.
+ * platform/graphics/InbandTextTrackPrivateClient.h:
+ * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
+ (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
+ * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
+ * platform/mac/SerializedPlatformDataCueMac.h: Renamed from Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.h.
+ (WebCore::SerializedPlatformDataCueMac::nativeValue const):
+ * platform/mac/SerializedPlatformDataCueMac.mm: Renamed from Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm.
+ (WebCore::SerializedPlatformDataCueMac::SerializedPlatformDataCueMac):
+ (WebCore::SerializedPlatformDataCueMac::~SerializedPlatformDataCueMac):
+ (WebCore::SerializedPlatformDataCueMac::create):
+ (WebCore::SerializedPlatformDataCueMac::data const):
+ (WebCore::SerializedPlatformDataCueMac::deserialize const):
+ (WebCore::SerializedPlatformDataCueMac::isEqual const):
+ (WebCore::toSerializedPlatformDataCueMac):
+ (WebCore::jsValueWithValueInContext):
+ (WebCore::jsValueWithDataInContext):
+ (WebCore::jsValueWithArrayInContext):
+ (WebCore::jsValueWithDictionaryInContext):
+ (WebCore::jsValueWithAVMetadataItemInContext):
+
2020-02-13 Per Arne Vollan <[email protected]>
[iOS] Check if PIP is supported in the UI process
Modified: trunk/Source/WebCore/Headers.cmake (256535 => 256536)
--- trunk/Source/WebCore/Headers.cmake 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/Headers.cmake 2020-02-13 21:40:08 UTC (rev 256536)
@@ -994,7 +994,7 @@
platform/ScrollbarTheme.h
platform/ScrollbarThemeComposite.h
platform/SearchPopupMenu.h
- platform/SerializedPlatformRepresentation.h
+ platform/SerializedPlatformDataCue.h
platform/SharedBuffer.h
platform/SharedStringHash.h
platform/SuddenTermination.h
Modified: trunk/Source/WebCore/PlatformMac.cmake (256535 => 256536)
--- trunk/Source/WebCore/PlatformMac.cmake 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/PlatformMac.cmake 2020-02-13 21:40:08 UTC (rev 256536)
@@ -381,7 +381,7 @@
platform/mac/ScrollAnimatorMac.mm
platform/mac/ScrollViewMac.mm
platform/mac/ScrollbarThemeMac.mm
- platform/mac/SerializedPlatformRepresentationMac.mm
+ platform/mac/SerializedPlatformDataCueMac.mm
platform/mac/StringUtilities.mm
platform/mac/SuddenTermination.mm
platform/mac/ThemeMac.mm
Modified: trunk/Source/WebCore/SourcesCocoa.txt (256535 => 256536)
--- trunk/Source/WebCore/SourcesCocoa.txt 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/SourcesCocoa.txt 2020-02-13 21:40:08 UTC (rev 256536)
@@ -463,7 +463,7 @@
platform/mac/ScrollAnimatorMac.mm @no-unify
platform/mac/ScrollViewMac.mm
platform/mac/ScrollbarThemeMac.mm @no-unify
-platform/mac/SerializedPlatformRepresentationMac.mm
+platform/mac/SerializedPlatformDataCueMac.mm
platform/mac/StringUtilities.mm
platform/mac/SuddenTermination.mm
platform/mac/ThemeMac.mm
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (256535 => 256536)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-02-13 21:40:08 UTC (rev 256536)
@@ -137,8 +137,8 @@
076970871463AD8700F502CF /* TextTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = 076970851463AD8700F502CF /* TextTrackList.h */; };
076F0D0E12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */; };
077664FD183E6B5C00133B92 /* JSQuickTimePluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 077664FB183E6B5C00133B92 /* JSQuickTimePluginReplacement.h */; };
- 077AF14018F4AE400001ED61 /* SerializedPlatformRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 077AF13E18F4AE400001ED61 /* SerializedPlatformRepresentation.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 077AF14318F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 077AF14118F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.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 */; };
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 */; };
@@ -5475,9 +5475,9 @@
076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerPrivateAVFoundation.h; sourceTree = "<group>"; };
077664FA183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSQuickTimePluginReplacement.cpp; sourceTree = "<group>"; };
077664FB183E6B5C00133B92 /* JSQuickTimePluginReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSQuickTimePluginReplacement.h; sourceTree = "<group>"; };
- 077AF13E18F4AE400001ED61 /* SerializedPlatformRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedPlatformRepresentation.h; sourceTree = "<group>"; };
- 077AF14118F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedPlatformRepresentationMac.h; sourceTree = "<group>"; };
- 077AF14218F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SerializedPlatformRepresentationMac.mm; sourceTree = "<group>"; };
+ 077AF13E18F4AE400001ED61 /* SerializedPlatformDataCue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedPlatformDataCue.h; sourceTree = "<group>"; };
+ 077AF14118F4B1BB0001ED61 /* SerializedPlatformDataCueMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedPlatformDataCueMac.h; sourceTree = "<group>"; };
+ 077AF14218F4B1BB0001ED61 /* SerializedPlatformDataCueMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SerializedPlatformDataCueMac.mm; sourceTree = "<group>"; };
077B64101B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaPlaybackTargetPickerMock.cpp; sourceTree = "<group>"; };
077B64111B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlaybackTargetPickerMock.h; sourceTree = "<group>"; };
077B64141B95F703003E9AD5 /* MediaPlaybackTargetMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaPlaybackTargetMock.cpp; sourceTree = "<group>"; };
@@ -20464,8 +20464,8 @@
BC8B853C0E7C7F1100AB6984 /* ScrollbarThemeMac.h */,
BCEF869E0E844E9D00A85CD5 /* ScrollbarThemeMac.mm */,
9353676A09AED88B00D35CD6 /* ScrollViewMac.mm */,
- 077AF14118F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.h */,
- 077AF14218F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.mm */,
+ 077AF14118F4B1BB0001ED61 /* SerializedPlatformDataCueMac.h */,
+ 077AF14218F4B1BB0001ED61 /* SerializedPlatformDataCueMac.mm */,
84B2B24F056BF15F00D2B771 /* SSLKeyGeneratorMac.mm */,
ECA680C61E67724500731D20 /* StringUtilities.h */,
ECA680C81E67730B00731D20 /* StringUtilities.mm */,
@@ -25960,7 +25960,7 @@
BC2441C30E8B65D00055320F /* ScrollView.cpp */,
BC6D6E2509AF943500F59759 /* ScrollView.h */,
AB7170880B3118080017123E /* SearchPopupMenu.h */,
- 077AF13E18F4AE400001ED61 /* SerializedPlatformRepresentation.h */,
+ 077AF13E18F4AE400001ED61 /* SerializedPlatformDataCue.h */,
1A4A954B0B4EDCCB002D8C3C /* SharedBuffer.cpp */,
1A4A954C0B4EDCCB002D8C3C /* SharedBuffer.h */,
834DFACE1F7DAE5700C2725B /* SharedStringHash.cpp */,
@@ -32215,8 +32215,8 @@
E45322AC140CE267005A0F92 /* SelectorQuery.h in Headers */,
F4D43D662188038B00ECECAC /* SerializedAttachmentData.h in Headers */,
E18DF33518AAF12C00773E59 /* SerializedCryptoKeyWrap.h in Headers */,
- 077AF14018F4AE400001ED61 /* SerializedPlatformRepresentation.h in Headers */,
- 077AF14318F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.h in Headers */,
+ 077AF14018F4AE400001ED61 /* SerializedPlatformDataCue.h in Headers */,
+ 077AF14318F4B1BB0001ED61 /* SerializedPlatformDataCueMac.h in Headers */,
A75E497610752ACB00C9B896 /* SerializedScriptValue.h in Headers */,
516F7F6D1C31E39A00F111DC /* ServerOpenDBRequest.h in Headers */,
2D93AEE319DF5641002A86C3 /* ServicesOverlayController.h in Headers */,
Modified: trunk/Source/WebCore/html/track/DataCue.cpp (256535 => 256536)
--- trunk/Source/WebCore/html/track/DataCue.cpp 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/html/track/DataCue.cpp 2020-02-13 21:40:08 UTC (rev 256536)
@@ -54,7 +54,7 @@
{
}
-DataCue::DataCue(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, RefPtr<SerializedPlatformRepresentation>&& platformValue, const String& type)
+DataCue::DataCue(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, RefPtr<SerializedPlatformDataCue>&& platformValue, const String& type)
: TextTrackCue(context, start, end)
, m_type(type)
, m_platformValue(WTFMove(platformValue))
@@ -116,7 +116,7 @@
if (m_data && m_data->data() && memcmp(m_data->data(), otherData->data(), m_data->byteLength()))
return false;
- const SerializedPlatformRepresentation* otherPlatformValue = dataCue->platformValue();
+ auto otherPlatformValue = dataCue->platformValue();
if ((otherPlatformValue && !m_platformValue) || (!otherPlatformValue && m_platformValue))
return false;
if (m_platformValue && !m_platformValue->isEqual(*otherPlatformValue))
Modified: trunk/Source/WebCore/html/track/DataCue.h (256535 => 256536)
--- trunk/Source/WebCore/html/track/DataCue.h 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/html/track/DataCue.h 2020-02-13 21:40:08 UTC (rev 256536)
@@ -28,7 +28,7 @@
#if ENABLE(VIDEO_TRACK)
-#include "SerializedPlatformRepresentation.h"
+#include "SerializedPlatformDataCue.h"
#include "TextTrackCue.h"
#include <_javascript_Core/ArrayBuffer.h>
#include <_javascript_Core/JSCJSValue.h>
@@ -57,7 +57,7 @@
return adoptRef(*new DataCue(context, start, end, data, type));
}
- static Ref<DataCue> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, RefPtr<SerializedPlatformRepresentation>&& platformValue, const String& type)
+ static Ref<DataCue> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, RefPtr<SerializedPlatformDataCue>&& platformValue, const String& type)
{
return adoptRef(*new DataCue(context, start, end, WTFMove(platformValue), type));
}
@@ -77,7 +77,7 @@
RefPtr<JSC::ArrayBuffer> data() const;
void setData(JSC::ArrayBuffer&);
- const SerializedPlatformRepresentation* platformValue() const { return m_platformValue.get(); }
+ const SerializedPlatformDataCue* platformValue() const { return m_platformValue.get(); }
JSC::JSValue value(JSC::JSGlobalObject&) const;
void setValue(JSC::JSGlobalObject&, JSC::JSValue);
@@ -94,7 +94,7 @@
private:
DataCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, ArrayBuffer&, const String&);
DataCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, const void*, unsigned);
- DataCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, RefPtr<SerializedPlatformRepresentation>&&, const String&);
+ DataCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, RefPtr<SerializedPlatformDataCue>&&, const String&);
DataCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, JSC::JSValue, const String&);
JSC::JSValue valueOrNull() const;
@@ -101,7 +101,7 @@
RefPtr<ArrayBuffer> m_data;
String m_type;
- RefPtr<SerializedPlatformRepresentation> m_platformValue;
+ RefPtr<SerializedPlatformDataCue> m_platformValue;
// FIXME: The following use of JSC::Strong is incorrect and can lead to storage leaks
// due to reference cycles; we should use JSValueInWrappedObject instead.
// https://bugs.webkit.org/show_bug.cgi?id=201173
Modified: trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp (256535 => 256536)
--- trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp 2020-02-13 21:40:08 UTC (rev 256536)
@@ -57,7 +57,7 @@
#if ENABLE(DATACUE_VALUE)
-void InbandDataTextTrack::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&& platformValue, const String& type)
+void InbandDataTextTrack::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&& platformValue, const String& type)
{
if (m_incompleteCueMap.contains(platformValue.ptr()))
return;
@@ -78,7 +78,7 @@
addCue(WTFMove(cue));
}
-void InbandDataTextTrack::updateDataCue(const MediaTime& start, const MediaTime& inEnd, SerializedPlatformRepresentation& platformValue)
+void InbandDataTextTrack::updateDataCue(const MediaTime& start, const MediaTime& inEnd, SerializedPlatformDataCue& platformValue)
{
RefPtr<DataCue> cue = m_incompleteCueMap.get(&platformValue);
if (!cue)
@@ -100,7 +100,7 @@
cue->didChange();
}
-void InbandDataTextTrack::removeDataCue(const MediaTime&, const MediaTime&, SerializedPlatformRepresentation& platformValue)
+void InbandDataTextTrack::removeDataCue(const MediaTime&, const MediaTime&, SerializedPlatformDataCue& platformValue)
{
if (auto cue = m_incompleteCueMap.take(&platformValue)) {
INFO_LOG(LOGIDENTIFIER, "removing: ", *cue);
@@ -112,7 +112,7 @@
{
ASSERT(cue.cueType() == TextTrackCue::Data);
- m_incompleteCueMap.remove(const_cast<SerializedPlatformRepresentation*>(toDataCue(&cue)->platformValue()));
+ m_incompleteCueMap.remove(const_cast<SerializedPlatformDataCue*>(toDataCue(&cue)->platformValue()));
return InbandTextTrack::removeCue(cue);
}
Modified: trunk/Source/WebCore/html/track/InbandDataTextTrack.h (256535 => 256536)
--- trunk/Source/WebCore/html/track/InbandDataTextTrack.h 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/html/track/InbandDataTextTrack.h 2020-02-13 21:40:08 UTC (rev 256536)
@@ -50,12 +50,12 @@
#endif
#if ENABLE(DATACUE_VALUE)
- void addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&&, const String&) final;
- void updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&) final;
- void removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&) final;
+ void addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&&, const String&) final;
+ void updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&) final;
+ void removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&) final;
ExceptionOr<void> removeCue(TextTrackCue&) final;
- HashMap<RefPtr<SerializedPlatformRepresentation>, RefPtr<DataCue>> m_incompleteCueMap;
+ HashMap<RefPtr<SerializedPlatformDataCue>, RefPtr<DataCue>> m_incompleteCueMap;
#endif
};
Modified: trunk/Source/WebCore/html/track/InbandTextTrack.h (256535 => 256536)
--- trunk/Source/WebCore/html/track/InbandTextTrack.h 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/html/track/InbandTextTrack.h 2020-02-13 21:40:08 UTC (rev 256536)
@@ -72,9 +72,9 @@
void addDataCue(const MediaTime&, const MediaTime&, const void*, unsigned) override { ASSERT_NOT_REACHED(); }
#if ENABLE(DATACUE_VALUE)
- void addDataCue(const MediaTime&, const MediaTime&, Ref<SerializedPlatformRepresentation>&&, const String&) override { ASSERT_NOT_REACHED(); }
- void updateDataCue(const MediaTime&, const MediaTime&, SerializedPlatformRepresentation&) override { ASSERT_NOT_REACHED(); }
- void removeDataCue(const MediaTime&, const MediaTime&, SerializedPlatformRepresentation&) override { ASSERT_NOT_REACHED(); }
+ void addDataCue(const MediaTime&, const MediaTime&, Ref<SerializedPlatformDataCue>&&, const String&) override { ASSERT_NOT_REACHED(); }
+ void updateDataCue(const MediaTime&, const MediaTime&, SerializedPlatformDataCue&) override { ASSERT_NOT_REACHED(); }
+ void removeDataCue(const MediaTime&, const MediaTime&, SerializedPlatformDataCue&) override { ASSERT_NOT_REACHED(); }
#endif
void addGenericCue(GenericCueData&) override { ASSERT_NOT_REACHED(); }
Copied: trunk/Source/WebCore/platform/SerializedPlatformDataCue.h (from rev 256535, trunk/Source/WebCore/platform/SerializedPlatformRepresentation.h) (0 => 256536)
--- trunk/Source/WebCore/platform/SerializedPlatformDataCue.h (rev 0)
+++ trunk/Source/WebCore/platform/SerializedPlatformDataCue.h 2020-02-13 21:40:08 UTC (rev 256536)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2014-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 <_javascript_Core/JSCInlines.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class SerializedPlatformDataCue : public RefCounted<SerializedPlatformDataCue> {
+public:
+ 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;
+
+ enum PlatformType {
+ ObjC,
+ };
+ virtual PlatformType platformType() const = 0;
+
+protected:
+ SerializedPlatformDataCue() = default;
+};
+
+} // namespace WebCore
+
+#endif
Deleted: trunk/Source/WebCore/platform/SerializedPlatformRepresentation.h (256535 => 256536)
--- trunk/Source/WebCore/platform/SerializedPlatformRepresentation.h 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/platform/SerializedPlatformRepresentation.h 2020-02-13 21:40:08 UTC (rev 256536)
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2014 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 <_javascript_Core/JSCInlines.h>
-#include <wtf/RefCounted.h>
-
-namespace WebCore {
-
-class SerializedPlatformRepresentation : public RefCounted<SerializedPlatformRepresentation> {
-public:
- virtual ~SerializedPlatformRepresentation() = default;
-
- virtual JSC::JSValue deserialize(JSC::JSGlobalObject*) const = 0;
- virtual RefPtr<JSC::ArrayBuffer> data() const = 0;
- virtual bool isEqual(const SerializedPlatformRepresentation&) const = 0;
-
- enum PlatformType {
- ObjC,
- };
- virtual PlatformType platformType() const = 0;
-
-protected:
- SerializedPlatformRepresentation() = default;
-};
-
-} // namespace WebCore
-
-#endif
Modified: trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h (256535 => 256536)
--- trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h 2020-02-13 21:40:08 UTC (rev 256536)
@@ -33,7 +33,7 @@
#include <wtf/MediaTime.h>
#if ENABLE(DATACUE_VALUE)
-#include "SerializedPlatformRepresentation.h"
+#include "SerializedPlatformDataCue.h"
#endif
namespace WebCore {
@@ -229,9 +229,9 @@
virtual void addDataCue(const MediaTime& start, const MediaTime& end, const void*, unsigned) = 0;
#if ENABLE(DATACUE_VALUE)
- virtual void addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&&, const String&) = 0;
- virtual void updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&) = 0;
- virtual void removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&) = 0;
+ virtual void addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&&, const String&) = 0;
+ virtual void updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&) = 0;
+ virtual void removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&) = 0;
#endif
virtual void addGenericCue(GenericCueData&) = 0;
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp (256535 => 256536)
--- trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp 2020-02-13 21:40:08 UTC (rev 256536)
@@ -54,7 +54,7 @@
#if ENABLE(DATACUE_VALUE)
-void InbandMetadataTextTrackPrivateAVF::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&& cueData, const String& type)
+void InbandMetadataTextTrackPrivateAVF::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&& cueData, const String& type)
{
ASSERT(cueFormat() == CueFormat::Data);
ASSERT(start >= MediaTime::zeroTime());
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h (256535 => 256536)
--- trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h 2020-02-13 21:40:08 UTC (rev 256536)
@@ -34,7 +34,7 @@
#if ENABLE(DATACUE_VALUE)
struct IncompleteMetaDataCue {
- RefPtr<SerializedPlatformRepresentation> cueData;
+ RefPtr<SerializedPlatformDataCue> cueData;
MediaTime startTime;
};
#endif
@@ -51,7 +51,7 @@
void setInBandMetadataTrackDispatchType(const AtomString& value) { m_inBandMetadataTrackDispatchType = value; }
#if ENABLE(DATACUE_VALUE)
- void addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&&, const String&);
+ void addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&&, const String&);
void updatePendingCueEndTimes(const MediaTime&);
#endif
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (256535 => 256536)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2020-02-13 21:40:08 UTC (rev 256536)
@@ -55,7 +55,7 @@
#import "PixelBufferConformerCV.h"
#import "PlatformTimeRanges.h"
#import "SecurityOrigin.h"
-#import "SerializedPlatformRepresentationMac.h"
+#import "SerializedPlatformDataCueMac.h"
#import "SharedBuffer.h"
#import "TextEncoding.h"
#import "TextTrackRepresentation.h"
@@ -3073,7 +3073,7 @@
if (item.keySpace)
type = metadataType(item.keySpace);
- m_metadataTrack->addDataCue(start, end, SerializedPlatformRepresentationMac::create(item), type);
+ m_metadataTrack->addDataCue(start, end, SerializedPlatformDataCueMac::create(item), type);
}
#endif
}
Copied: trunk/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.h (from rev 256535, trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.h) (0 => 256536)
--- trunk/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.h (rev 0)
+++ trunk/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.h 2020-02-13 21:40:08 UTC (rev 256536)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2014-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_TRACK) && ENABLE(DATACUE_VALUE)
+
+#include "SerializedPlatformDataCue.h"
+
+#if USE(FOUNDATION) && !defined(__OBJC__)
+typedef struct objc_object *id;
+#endif
+
+namespace WebCore {
+
+class SerializedPlatformDataCueMac final : public SerializedPlatformDataCue {
+public:
+ 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 SerializedPlatformDataCue::ObjC; }
+
+ id nativeValue() const { return m_nativeValue.get(); }
+
+private:
+ explicit SerializedPlatformDataCueMac(id nativeValue);
+
+ RetainPtr<id> m_nativeValue;
+};
+
+SerializedPlatformDataCueMac* toSerializedPlatformDataCueMac(SerializedPlatformDataCue*);
+const SerializedPlatformDataCueMac* toSerializedPlatformDataCueMac(const SerializedPlatformDataCue*);
+
+} // namespace WebCore
+
+#endif
Copied: trunk/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm (from rev 256535, trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm) (0 => 256536)
--- trunk/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm (rev 0)
+++ trunk/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm 2020-02-13 21:40:08 UTC (rev 256536)
@@ -0,0 +1,239 @@
+/*
+ * Copyright (C) 2014-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 "SerializedPlatformDataCueMac.h"
+
+#if ENABLE(VIDEO_TRACK) && ENABLE(DATACUE_VALUE)
+
+#import "JSDOMConvertBufferSource.h"
+#import <AVFoundation/AVMetadataItem.h>
+#import <Foundation/NSString.h>
+#import <_javascript_Core/APICast.h>
+#import <_javascript_Core/ArrayBuffer.h>
+#import <_javascript_Core/JSArrayBuffer.h>
+#import <_javascript_Core/JSContextRef.h>
+#import <_javascript_Core/JSObjectRef.h>
+#import <_javascript_Core/_javascript_Core.h>
+#import <objc/runtime.h>
+#import <pal/cocoa/AVFoundationSoftLink.h>
+
+namespace WebCore {
+
+#if JSC_OBJC_API_ENABLED
+static JSValue *jsValueWithDataInContext(NSData *, JSContext *);
+static JSValue *jsValueWithArrayInContext(NSArray *, JSContext *);
+static JSValue *jsValueWithDictionaryInContext(NSDictionary *, JSContext *);
+static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *, JSContext *);
+static JSValue *jsValueWithValueInContext(id, JSContext *);
+#endif
+
+SerializedPlatformDataCueMac::SerializedPlatformDataCueMac(id nativeValue)
+ : SerializedPlatformDataCue()
+ , m_nativeValue(nativeValue)
+{
+}
+
+SerializedPlatformDataCueMac::~SerializedPlatformDataCueMac()
+{
+}
+
+Ref<SerializedPlatformDataCue> SerializedPlatformDataCueMac::create(id nativeValue)
+{
+ return adoptRef(*new SerializedPlatformDataCueMac(nativeValue));
+}
+
+RefPtr<ArrayBuffer> SerializedPlatformDataCueMac::data() const
+{
+ return nullptr;
+}
+
+JSC::JSValue SerializedPlatformDataCueMac::deserialize(JSC::JSGlobalObject* lexicalGlobalObject) const
+{
+#if JSC_OBJC_API_ENABLED
+ if (!m_nativeValue)
+ return JSC::jsNull();
+
+ JSGlobalContextRef jsGlobalContextRef = toGlobalRef(lexicalGlobalObject);
+ JSContext *jsContext = [JSContext contextWithJSGlobalContextRef:jsGlobalContextRef];
+ JSValue *serializedValue = jsValueWithValueInContext(m_nativeValue.get(), jsContext);
+
+ return toJS(lexicalGlobalObject, [serializedValue JSValueRef]);
+#else
+ UNUSED_PARAM(lexicalGlobalObject);
+ return JSC::jsNull();
+#endif
+}
+
+bool SerializedPlatformDataCueMac::isEqual(const SerializedPlatformDataCue& other) const
+{
+ if (other.platformType() != SerializedPlatformDataCue::ObjC)
+ return false;
+
+ const SerializedPlatformDataCueMac* otherObjC = toSerializedPlatformDataCueMac(&other);
+
+ if (!m_nativeValue || !otherObjC->nativeValue())
+ return false;
+
+ return [m_nativeValue.get() isEqual:otherObjC->nativeValue()];
+}
+
+SerializedPlatformDataCueMac* toSerializedPlatformDataCueMac(SerializedPlatformDataCue* rep)
+{
+ return const_cast<SerializedPlatformDataCueMac*>(toSerializedPlatformDataCueMac(const_cast<const SerializedPlatformDataCue*>(rep)));
+}
+
+const SerializedPlatformDataCueMac* toSerializedPlatformDataCueMac(const SerializedPlatformDataCue* rep)
+{
+ RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(rep->platformType() == SerializedPlatformDataCue::ObjC);
+ return static_cast<const SerializedPlatformDataCueMac*>(rep);
+}
+
+#if JSC_OBJC_API_ENABLED
+static JSValue *jsValueWithValueInContext(id value, JSContext *context)
+{
+ if ([value isKindOfClass:[NSString class]] || [value isKindOfClass:[NSNumber class]])
+ return [JSValue valueWithObject:value inContext:context];
+
+ if ([value isKindOfClass:[NSLocale class]])
+ return [JSValue valueWithObject:[value localeIdentifier] inContext:context];
+
+ if ([value isKindOfClass:[NSDictionary class]])
+ return jsValueWithDictionaryInContext(value, context);
+
+ if ([value isKindOfClass:[NSArray class]])
+ return jsValueWithArrayInContext(value, context);
+
+ if ([value isKindOfClass:[NSData class]])
+ return jsValueWithDataInContext(value, context);
+
+ if ([value isKindOfClass:PAL::getAVMetadataItemClass()])
+ return jsValueWithAVMetadataItemInContext(value, context);
+
+ return nil;
+}
+
+static JSValue *jsValueWithDataInContext(NSData *data, JSContext *context)
+{
+ auto dataArray = ArrayBuffer::tryCreate([data bytes], [data length]);
+
+ auto* lexicalGlobalObject = toJS([context JSGlobalContextRef]);
+ JSC::JSValue array = toJS(lexicalGlobalObject, JSC::jsCast<JSDOMGlobalObject*>(lexicalGlobalObject), dataArray.get());
+
+ return [JSValue valueWithJSValueRef:toRef(lexicalGlobalObject, array) inContext:context];
+}
+
+static JSValue *jsValueWithArrayInContext(NSArray *array, JSContext *context)
+{
+ JSValueRef exception = 0;
+ JSValue *result = [JSValue valueWithNewArrayInContext:context];
+ JSObjectRef resultObject = JSValueToObject([context JSGlobalContextRef], [result JSValueRef], &exception);
+ if (exception)
+ return [JSValue valueWithUndefinedInContext:context];
+
+ NSUInteger count = [array count];
+ for (NSUInteger i = 0; i < count; ++i) {
+ JSValue *value = jsValueWithValueInContext([array objectAtIndex:i], context);
+ if (!value)
+ continue;
+
+ JSObjectSetPropertyAtIndex([context JSGlobalContextRef], resultObject, (unsigned)i, [value JSValueRef], &exception);
+ if (exception)
+ continue;
+ }
+
+ return result;
+}
+
+static JSValue *jsValueWithDictionaryInContext(NSDictionary *dictionary, JSContext *context)
+{
+ JSValueRef exception = 0;
+ JSValue *result = [JSValue valueWithNewObjectInContext:context];
+ JSObjectRef resultObject = JSValueToObject([context JSGlobalContextRef], [result JSValueRef], &exception);
+ if (exception)
+ return [JSValue valueWithUndefinedInContext:context];
+
+ for (id key in [dictionary keyEnumerator]) {
+ if (![key isKindOfClass:[NSString class]])
+ continue;
+
+ JSValue *value = jsValueWithValueInContext([dictionary objectForKey:key], context);
+ if (!value)
+ continue;
+
+ auto name = OpaqueJSString::tryCreate(key);
+ JSObjectSetProperty([context JSGlobalContextRef], resultObject, name.get(), [value JSValueRef], 0, &exception);
+ if (exception)
+ continue;
+ }
+
+ return result;
+}
+
+static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *item, JSContext *context)
+{
+ NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+
+ NSDictionary *extras = [item extraAttributes];
+ for (id key in [extras keyEnumerator]) {
+ if (![key isKindOfClass:[NSString class]])
+ continue;
+ id value = [extras objectForKey:key];
+ NSString *keyString = key;
+
+ if ([key isEqualToString:@"MIMEtype"])
+ keyString = @"type";
+ else if ([key isEqualToString:@"dataTypeNamespace"] || [key isEqualToString:@"pictureType"])
+ continue;
+ else if ([key isEqualToString:@"dataType"]) {
+ id dataTypeNamespace = [extras objectForKey:@"dataTypeNamespace"];
+ if (!dataTypeNamespace || ![dataTypeNamespace isKindOfClass:[NSString class]] || ![dataTypeNamespace isEqualToString:@"org.iana.media-type"])
+ continue;
+ keyString = @"type";
+ } else if ([value isKindOfClass:[NSString class]]) {
+ if (![value length])
+ continue;
+ keyString = [key lowercaseString];
+ }
+
+ [dictionary setObject:value forKey:keyString];
+ }
+
+ if (item.key)
+ [dictionary setObject:item.key forKey:@"key"];
+
+ if (item.locale)
+ [dictionary setObject:item.locale forKey:@"locale"];
+
+ if (item.value)
+ [dictionary setObject:item.value forKey:@"data"];
+
+ return jsValueWithDictionaryInContext(dictionary, context);
+}
+#endif
+
+} // namespace WebCore
+
+#endif
Deleted: trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.h (256535 => 256536)
--- trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.h 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.h 2020-02-13 21:40:08 UTC (rev 256536)
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2014 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.
- */
-
-#ifndef SerializedPlatformRepresentationMac_h
-#define SerializedPlatformRepresentationMac_h
-
-#if ENABLE(VIDEO_TRACK) && ENABLE(DATACUE_VALUE)
-
-#include "SerializedPlatformRepresentation.h"
-
-#if USE(FOUNDATION) && !defined(__OBJC__)
-typedef struct objc_object *id;
-#endif
-
-namespace WebCore {
-
-class SerializedPlatformRepresentationMac : public SerializedPlatformRepresentation {
-public:
- virtual ~SerializedPlatformRepresentationMac();
- static Ref<SerializedPlatformRepresentation> create(id);
-
- JSC::JSValue deserialize(JSC::JSGlobalObject*) const override;
- RefPtr<ArrayBuffer> data() const override;
-
- bool isEqual(const SerializedPlatformRepresentation&) const override;
-
- PlatformType platformType() const override { return SerializedPlatformRepresentation::ObjC; }
-
- id nativeValue() const { return m_nativeValue.get(); }
-
-private:
- SerializedPlatformRepresentationMac(id nativeValue);
-
- RetainPtr<id> m_nativeValue;
-};
-
-SerializedPlatformRepresentationMac* toSerializedPlatformRepresentationMac(SerializedPlatformRepresentation*);
-const SerializedPlatformRepresentationMac* toSerializedPlatformRepresentationMac(const SerializedPlatformRepresentation*);
-
-} // namespace WebCore
-
-#endif
-#endif // SerializedPlatformRepresentationMac_h
Deleted: trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm (256535 => 256536)
--- trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm 2020-02-13 21:40:08 UTC (rev 256536)
@@ -1,241 +0,0 @@
-/*
- * Copyright (C) 2014, 2015 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"
-
-#if ENABLE(VIDEO_TRACK) && ENABLE(DATACUE_VALUE)
-#include "SerializedPlatformRepresentationMac.h"
-
-#import "JSDOMConvertBufferSource.h"
-#import <AVFoundation/AVMetadataItem.h>
-#import <Foundation/NSString.h>
-#import <_javascript_Core/APICast.h>
-#import <_javascript_Core/ArrayBuffer.h>
-#import <_javascript_Core/JSArrayBuffer.h>
-#import <_javascript_Core/JSContextRef.h>
-#import <_javascript_Core/JSObjectRef.h>
-#import <_javascript_Core/_javascript_Core.h>
-#import <objc/runtime.h>
-#import <wtf/text/Base64.h>
-
-#import <pal/cocoa/AVFoundationSoftLink.h>
-
-namespace WebCore {
-
-#if JSC_OBJC_API_ENABLED
-static JSValue *jsValueWithDataInContext(NSData *, JSContext *);
-static JSValue *jsValueWithArrayInContext(NSArray *, JSContext *);
-static JSValue *jsValueWithDictionaryInContext(NSDictionary *, JSContext *);
-static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *, JSContext *);
-static JSValue *jsValueWithValueInContext(id, JSContext *);
-#endif
-
-SerializedPlatformRepresentationMac::SerializedPlatformRepresentationMac(id nativeValue)
- : SerializedPlatformRepresentation()
- , m_nativeValue(nativeValue)
-{
-}
-
-SerializedPlatformRepresentationMac::~SerializedPlatformRepresentationMac()
-{
-}
-
-Ref<SerializedPlatformRepresentation> SerializedPlatformRepresentationMac::create(id nativeValue)
-{
- return adoptRef(*new SerializedPlatformRepresentationMac(nativeValue));
-}
-
-RefPtr<ArrayBuffer> SerializedPlatformRepresentationMac::data() const
-{
- return nullptr;
-}
-
-JSC::JSValue SerializedPlatformRepresentationMac::deserialize(JSC::JSGlobalObject* lexicalGlobalObject) const
-{
-#if JSC_OBJC_API_ENABLED
- if (!m_nativeValue)
- return JSC::jsNull();
-
- JSGlobalContextRef jsGlobalContextRef = toGlobalRef(lexicalGlobalObject);
- JSContext *jsContext = [JSContext contextWithJSGlobalContextRef:jsGlobalContextRef];
- JSValue *serializedValue = jsValueWithValueInContext(m_nativeValue.get(), jsContext);
-
- return toJS(lexicalGlobalObject, [serializedValue JSValueRef]);
-#else
- UNUSED_PARAM(lexicalGlobalObject);
- return JSC::jsNull();
-#endif
-}
-
-bool SerializedPlatformRepresentationMac::isEqual(const SerializedPlatformRepresentation& other) const
-{
- if (other.platformType() != SerializedPlatformRepresentation::ObjC)
- return false;
-
- const SerializedPlatformRepresentationMac* otherObjC = toSerializedPlatformRepresentationMac(&other);
-
- if (!m_nativeValue || !otherObjC->nativeValue())
- return false;
-
- return [m_nativeValue.get() isEqual:otherObjC->nativeValue()];
-}
-
-SerializedPlatformRepresentationMac* toSerializedPlatformRepresentationMac(SerializedPlatformRepresentation* rep)
-{
- return const_cast<SerializedPlatformRepresentationMac*>(toSerializedPlatformRepresentationMac(const_cast<const SerializedPlatformRepresentation*>(rep)));
-}
-
-const SerializedPlatformRepresentationMac* toSerializedPlatformRepresentationMac(const SerializedPlatformRepresentation* rep)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(rep->platformType() == SerializedPlatformRepresentation::ObjC);
- return static_cast<const SerializedPlatformRepresentationMac*>(rep);
-}
-
-#if JSC_OBJC_API_ENABLED
-static JSValue *jsValueWithValueInContext(id value, JSContext *context)
-{
- if ([value isKindOfClass:[NSString class]] || [value isKindOfClass:[NSNumber class]])
- return [JSValue valueWithObject:value inContext:context];
-
- if ([value isKindOfClass:[NSLocale class]])
- return [JSValue valueWithObject:[value localeIdentifier] inContext:context];
-
- if ([value isKindOfClass:[NSDictionary class]])
- return jsValueWithDictionaryInContext(value, context);
-
- if ([value isKindOfClass:[NSArray class]])
- return jsValueWithArrayInContext(value, context);
-
- if ([value isKindOfClass:[NSData class]])
- return jsValueWithDataInContext(value, context);
-
- if ([value isKindOfClass:PAL::getAVMetadataItemClass()])
- return jsValueWithAVMetadataItemInContext(value, context);
-
- return nil;
-}
-
-static JSValue *jsValueWithDataInContext(NSData *data, JSContext *context)
-{
- auto dataArray = ArrayBuffer::tryCreate([data bytes], [data length]);
-
- auto* lexicalGlobalObject = toJS([context JSGlobalContextRef]);
- JSC::JSValue array = toJS(lexicalGlobalObject, JSC::jsCast<JSDOMGlobalObject*>(lexicalGlobalObject), dataArray.get());
-
- return [JSValue valueWithJSValueRef:toRef(lexicalGlobalObject, array) inContext:context];
-}
-
-static JSValue *jsValueWithArrayInContext(NSArray *array, JSContext *context)
-{
- JSValueRef exception = 0;
- JSValue *result = [JSValue valueWithNewArrayInContext:context];
- JSObjectRef resultObject = JSValueToObject([context JSGlobalContextRef], [result JSValueRef], &exception);
- if (exception)
- return [JSValue valueWithUndefinedInContext:context];
-
- NSUInteger count = [array count];
- for (NSUInteger i = 0; i < count; ++i) {
- JSValue *value = jsValueWithValueInContext([array objectAtIndex:i], context);
- if (!value)
- continue;
-
- JSObjectSetPropertyAtIndex([context JSGlobalContextRef], resultObject, (unsigned)i, [value JSValueRef], &exception);
- if (exception)
- continue;
- }
-
- return result;
-}
-
-static JSValue *jsValueWithDictionaryInContext(NSDictionary *dictionary, JSContext *context)
-{
- JSValueRef exception = 0;
- JSValue *result = [JSValue valueWithNewObjectInContext:context];
- JSObjectRef resultObject = JSValueToObject([context JSGlobalContextRef], [result JSValueRef], &exception);
- if (exception)
- return [JSValue valueWithUndefinedInContext:context];
-
- for (id key in [dictionary keyEnumerator]) {
- if (![key isKindOfClass:[NSString class]])
- continue;
-
- JSValue *value = jsValueWithValueInContext([dictionary objectForKey:key], context);
- if (!value)
- continue;
-
- auto name = OpaqueJSString::tryCreate(key);
- JSObjectSetProperty([context JSGlobalContextRef], resultObject, name.get(), [value JSValueRef], 0, &exception);
- if (exception)
- continue;
- }
-
- return result;
-}
-
-static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *item, JSContext *context)
-{
- NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
-
- NSDictionary *extras = [item extraAttributes];
- for (id key in [extras keyEnumerator]) {
- if (![key isKindOfClass:[NSString class]])
- continue;
- id value = [extras objectForKey:key];
- NSString *keyString = key;
-
- if ([key isEqualToString:@"MIMEtype"])
- keyString = @"type";
- else if ([key isEqualToString:@"dataTypeNamespace"] || [key isEqualToString:@"pictureType"])
- continue;
- else if ([key isEqualToString:@"dataType"]) {
- id dataTypeNamespace = [extras objectForKey:@"dataTypeNamespace"];
- if (!dataTypeNamespace || ![dataTypeNamespace isKindOfClass:[NSString class]] || ![dataTypeNamespace isEqualToString:@"org.iana.media-type"])
- continue;
- keyString = @"type";
- } else if ([value isKindOfClass:[NSString class]]) {
- if (![value length])
- continue;
- keyString = [key lowercaseString];
- }
-
- [dictionary setObject:value forKey:keyString];
- }
-
- if (item.key)
- [dictionary setObject:item.key forKey:@"key"];
-
- if (item.locale)
- [dictionary setObject:item.locale forKey:@"locale"];
-
- if (item.value)
- [dictionary setObject:item.value forKey:@"data"];
-
- return jsValueWithDictionaryInContext(dictionary, context);
-}
-#endif
-
-} // namespace WebCore
-
-#endif
Modified: trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp (256535 => 256536)
--- trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp 2020-02-13 21:40:08 UTC (rev 256536)
@@ -102,17 +102,17 @@
}
#if ENABLE(DATACUE_VALUE)
-void RemoteTextTrackProxy::addDataCue(const MediaTime&, const MediaTime&, Ref<SerializedPlatformRepresentation>&&, const String&)
+void RemoteTextTrackProxy::addDataCue(const MediaTime&, const MediaTime&, Ref<SerializedPlatformDataCue>&&, const String&)
{
notImplemented();
}
-void RemoteTextTrackProxy::updateDataCue(const MediaTime&, const MediaTime&, SerializedPlatformRepresentation&)
+void RemoteTextTrackProxy::updateDataCue(const MediaTime&, const MediaTime&, SerializedPlatformDataCue&)
{
notImplemented();
}
-void RemoteTextTrackProxy::removeDataCue(const MediaTime&, const MediaTime&, SerializedPlatformRepresentation&)
+void RemoteTextTrackProxy::removeDataCue(const MediaTime&, const MediaTime&, SerializedPlatformDataCue&)
{
notImplemented();
}
Modified: trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.h (256535 => 256536)
--- trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.h 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.h 2020-02-13 21:40:08 UTC (rev 256536)
@@ -56,9 +56,9 @@
virtual void addDataCue(const MediaTime& start, const MediaTime& end, const void*, unsigned);
#if ENABLE(DATACUE_VALUE)
- virtual void addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&&, const String&);
- virtual void updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&);
- virtual void removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&);
+ virtual void addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&&, const String&);
+ virtual void updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&);
+ virtual void removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&);
#endif
virtual void addGenericCue(GenericCueData&);
Modified: trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in (256535 => 256536)
--- trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in 2020-02-13 21:40:08 UTC (rev 256536)
@@ -51,9 +51,9 @@
ParseWebVTTCueDataStruct(WebKit::TrackPrivateRemoteIdentifier trackID, WebCore::ISOWebVTTCue cueData)
## AddDataCue(MediaTime start, MediaTime end, IPC::DataReference data)
- ## AddDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformRepresentation data, String type)
- ## UpdateDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformRepresentation data)
- ## RemoveDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformRepresentation 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)
## AddGenericCue(WebCore::GenericCueData cue)
## UpdateGenericCue(WebCore::GenericCueData cue)
Modified: trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp (256535 => 256536)
--- trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp 2020-02-13 21:40:08 UTC (rev 256536)
@@ -94,17 +94,17 @@
}
#if ENABLE(DATACUE_VALUE)
-void TextTrackPrivateRemote::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&&, const String&)
+void TextTrackPrivateRemote::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&&, const String&)
{
notImplemented();
}
-void TextTrackPrivateRemote::updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&)
+void TextTrackPrivateRemote::updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&)
{
notImplemented();
}
-void TextTrackPrivateRemote::removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&)
+void TextTrackPrivateRemote::removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&)
{
notImplemented();
}
Modified: trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h (256535 => 256536)
--- trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h 2020-02-13 21:26:33 UTC (rev 256535)
+++ trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h 2020-02-13 21:40:08 UTC (rev 256536)
@@ -47,9 +47,9 @@
void addDataCue(const MediaTime& start, const MediaTime& end, const void*, unsigned);
#if ENABLE(DATACUE_VALUE)
- void addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&&, const String&);
- void updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&);
- void removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&);
+ 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&);
#endif
void addGenericCue(GenericCueData&);