Diff
Modified: trunk/LayoutTests/ChangeLog (210024 => 210025)
--- trunk/LayoutTests/ChangeLog 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/LayoutTests/ChangeLog 2016-12-20 18:52:56 UTC (rev 210025)
@@ -1,3 +1,15 @@
+2016-12-20 Sam Weinig <[email protected]>
+
+ [DataCue] Un-prefix DataCue and remove custom bindings
+ https://bugs.webkit.org/show_bug.cgi?id=166087
+
+ Reviewed by Eric Carlson.
+
+ * media/track/track-datacue-value-expected.txt:
+ * media/track/track-datacue-value.html:
+ * platform/mac/js/dom/global-constructors-attributes-expected.txt:
+ Update tests for unprefixed DataCue.
+
2016-12-20 Wenson Hsieh <[email protected]>
Implement the updated port/area-based Scroll Snap Module Level 1 Spec
Modified: trunk/LayoutTests/media/track/track-datacue-value-expected.txt (210024 => 210025)
--- trunk/LayoutTests/media/track/track-datacue-value-expected.txt 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/LayoutTests/media/track/track-datacue-value-expected.txt 2016-12-20 18:52:56 UTC (rev 210025)
@@ -1,8 +1,8 @@
-Tests WebKitDataCue.value
+Tests DataCue.value
*** Initialize with string.
-RUN(cue = new WebKitDataCue(2, 6, 'test'))
+RUN(cue = new DataCue(2, 6, 'test'))
EXPECTED (cue.id == '') OK
EXPECTED (cue.startTime == '2') OK
EXPECTED (cue.endTime == '6') OK
@@ -13,7 +13,7 @@
EXPECTED (cue.type == '') OK
*** Initialize with an object.
-RUN(cue = new WebKitDataCue(9, 16, { data: [1, 2, 3] }, 'org.test'))
+RUN(cue = new DataCue(9, 16, { data: [1, 2, 3] }, 'org.test'))
EXPECTED (cue.id == '') OK
EXPECTED (cue.startTime == '9') OK
EXPECTED (cue.endTime == '16') OK
Modified: trunk/LayoutTests/media/track/track-datacue-value.html (210024 => 210025)
--- trunk/LayoutTests/media/track/track-datacue-value.html 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/LayoutTests/media/track/track-datacue-value.html 2016-12-20 18:52:56 UTC (rev 210025)
@@ -9,7 +9,7 @@
function loaded()
{
consoleWrite("<br>*** Initialize with string.");
- run("cue = new WebKitDataCue(2, 6, 'test')");
+ run("cue = new DataCue(2, 6, 'test')");
testExpected("cue.id", "");
testExpected("cue.startTime", 2);
testExpected("cue.endTime", 6);
@@ -20,7 +20,7 @@
testExpected("cue.type", '');
consoleWrite("<br>*** Initialize with an object.");
- run("cue = new WebKitDataCue(9, 16, { data: [1, 2, 3] }, 'org.test')");
+ run("cue = new DataCue(9, 16, { data: [1, 2, 3] }, 'org.test')");
testExpected("cue.id", "");
testExpected("cue.startTime", 9);
testExpected("cue.endTime", 16);
@@ -45,6 +45,6 @@
</script>
</head>
<body _onload_="loaded()">
- <p>Tests WebKitDataCue.value</p>
+ <p>Tests DataCue.value</p>
</body>
</html>
Modified: trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt (210024 => 210025)
--- trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt 2016-12-20 18:52:56 UTC (rev 210025)
@@ -373,6 +373,11 @@
PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'DOMTokenList').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'DataCue').value is DataCue
+PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DataCue').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'DataCue').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'DataCue').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'DataTransfer').value is DataTransfer
PASS Object.getOwnPropertyDescriptor(global, 'DataTransfer').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'DataTransfer').hasOwnProperty('set') is false
@@ -2393,11 +2398,6 @@
PASS Object.getOwnPropertyDescriptor(global, 'WebKitCSSRegionRule').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'WebKitCSSRegionRule').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'WebKitCSSRegionRule').configurable is true
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitDataCue').value is WebKitDataCue
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitDataCue').hasOwnProperty('get') is false
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitDataCue').hasOwnProperty('set') is false
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitDataCue').enumerable is false
-PASS Object.getOwnPropertyDescriptor(global, 'WebKitDataCue').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyError').value is WebKitMediaKeyError
PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyError').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'WebKitMediaKeyError').hasOwnProperty('set') is false
Modified: trunk/Source/WebCore/CMakeLists.txt (210024 => 210025)
--- trunk/Source/WebCore/CMakeLists.txt 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/CMakeLists.txt 2016-12-20 18:52:56 UTC (rev 210025)
@@ -1119,7 +1119,6 @@
bindings/js/JSDOMWindowProperties.cpp
bindings/js/JSDOMWindowShell.cpp
bindings/js/JSDOMWrapper.cpp
- bindings/js/JSDataCueCustom.cpp
bindings/js/JSDeviceMotionEventCustom.cpp
bindings/js/JSDeviceOrientationEventCustom.cpp
bindings/js/JSDocumentCustom.cpp
Modified: trunk/Source/WebCore/ChangeLog (210024 => 210025)
--- trunk/Source/WebCore/ChangeLog 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/ChangeLog 2016-12-20 18:52:56 UTC (rev 210025)
@@ -1,3 +1,40 @@
+2016-12-20 Sam Weinig <[email protected]>
+
+ [DataCue] Un-prefix DataCue and remove custom bindings
+ https://bugs.webkit.org/show_bug.cgi?id=166087
+
+ Reviewed by Eric Carlson.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSBindingsAllInOne.cpp:
+ * bindings/js/JSDataCueCustom.cpp: Removed.
+ Remove JSDataCueCustom.cpp
+
+ * bindings/js/JSTextTrackCueCustom.cpp:
+ (WebCore::toJSNewlyCreated):
+ Remove out of date comment.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateConstructorDefinition):
+ Update constructor generation code to use JSDOMConvert.
+
+ * html/track/DataCue.cpp:
+ (WebCore::DataCue::DataCue):
+ (WebCore::DataCue::~DataCue):
+ (WebCore::DataCue::data):
+ (WebCore::DataCue::setData):
+ (WebCore::DataCue::cueContentsMatch):
+ (WebCore::DataCue::value):
+ (WebCore::DataCue::setValue):
+ (WebCore::DataCue::valueOrNull):
+ * html/track/DataCue.h:
+ * html/track/DataCue.idl:
+ * platform/SerializedPlatformRepresentation.h:
+ Remove DATACUE_VALUE define from web exposed classes, so the interface can
+ be the same on all platforms. Platforms that don't support DATACUE_VALUE will
+ just never have any value. Also remove custom annotations.
+
2016-12-20 Wenson Hsieh <[email protected]>
Implement the updated port/area-based Scroll Snap Module Level 1 Spec
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (210024 => 210025)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-12-20 18:52:56 UTC (rev 210025)
@@ -302,7 +302,6 @@
07F0B97C1AC5DB4600E535D9 /* AVFoundationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F0B97B1AC5DB4600E535D9 /* AVFoundationSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
07F876841AD580F900905849 /* MediaPlaybackTargetContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F876831AD4A94500905849 /* MediaPlaybackTargetContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
07F944161864D046005D31CB /* PlatformMediaSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAE8C081746B95700532D78 /* PlatformMediaSessionManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 07FBDE2C18FED178001A7CFF /* JSDataCueCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07FBDE2B18FED178001A7CFF /* JSDataCueCustom.cpp */; };
07FE99DC18807A7D00256648 /* MediaElementSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07FE99DA18807A7D00256648 /* MediaElementSession.cpp */; };
07FE99DD18807A7D00256648 /* MediaElementSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 07FE99DB18807A7D00256648 /* MediaElementSession.h */; settings = {ATTRIBUTES = (Private, ); }; };
07FFDE68181AED420072D409 /* MediaStreamTrackPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07FFDE66181AED420072D409 /* MediaStreamTrackPrivate.cpp */; };
@@ -7289,7 +7288,6 @@
07F0B9791AC5DB3300E535D9 /* AVKitSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVKitSPI.h; sourceTree = "<group>"; };
07F0B97B1AC5DB4600E535D9 /* AVFoundationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVFoundationSPI.h; sourceTree = "<group>"; };
07F876831AD4A94500905849 /* MediaPlaybackTargetContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlaybackTargetContext.h; sourceTree = "<group>"; };
- 07FBDE2B18FED178001A7CFF /* JSDataCueCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDataCueCustom.cpp; sourceTree = "<group>"; };
07FE99DA18807A7D00256648 /* MediaElementSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaElementSession.cpp; sourceTree = "<group>"; };
07FE99DB18807A7D00256648 /* MediaElementSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaElementSession.h; sourceTree = "<group>"; };
07FFDE66181AED420072D409 /* MediaStreamTrackPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamTrackPrivate.cpp; sourceTree = "<group>"; };
@@ -22129,7 +22127,6 @@
AD726FEA16D9F40B003A4E6D /* JSCSSStyleDeclarationCustom.h */,
9BC5F9DF1D5AAF6A002B749D /* JSCustomElementRegistryCustom.cpp */,
DEC2975D1B4DEB2A005F5945 /* JSCustomEventCustom.cpp */,
- 07FBDE2B18FED178001A7CFF /* JSDataCueCustom.cpp */,
31FB1A6B120A5D6900DC02A0 /* JSDeviceMotionEventCustom.cpp */,
590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */,
49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
@@ -29902,7 +29899,6 @@
1AE82F8F0CAAFA9D002237AE /* JSDatabase.cpp in Sources */,
B59DD69A119029E5007E9684 /* JSDatabaseCallback.cpp in Sources */,
BE61039D18A9D65200DD50D7 /* JSDataCue.cpp in Sources */,
- 07FBDE2C18FED178001A7CFF /* JSDataCueCustom.cpp in Sources */,
BCA83E4F0D7CE1E9003421A8 /* JSDataTransfer.cpp in Sources */,
4162A4571011464700DFF3ED /* JSDedicatedWorkerGlobalScope.cpp in Sources */,
FDA15ED112B03F94003A583A /* JSDelayNode.cpp in Sources */,
Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (210024 => 210025)
--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp 2016-12-20 18:52:56 UTC (rev 210025)
@@ -60,7 +60,6 @@
#include "JSDOMWindowProperties.cpp"
#include "JSDOMWindowShell.cpp"
#include "JSDOMWrapper.cpp"
-#include "JSDataCueCustom.cpp"
#include "JSDeviceOrientationEventCustom.cpp"
#include "JSDocumentCustom.cpp"
#include "JSDocumentFragmentCustom.cpp"
Deleted: trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp (210024 => 210025)
--- trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp 2016-12-20 18:52:56 UTC (rev 210025)
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2014, 2016 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. ``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
- * 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)
-
-#include "JSDataCue.h"
-
-#include "JSDOMBinding.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-#if ENABLE(DATACUE_VALUE)
-JSValue JSDataCue::value(ExecState& state) const
-{
- return wrapped().value(&state);
-}
-
-void JSDataCue::setValue(ExecState& state, JSValue value)
-{
- wrapped().setValue(&state, value);
-}
-#endif
-
-EncodedJSValue JSC_HOST_CALL constructJSDataCue(ExecState& exec)
-{
- VM& vm = exec.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- DOMConstructorObject* castedThis = jsCast<DOMConstructorObject*>(exec.jsCallee());
- ASSERT(castedThis);
- if (exec.argumentCount() < 3)
- return throwVMError(&exec, scope, createNotEnoughArgumentsError(&exec));
-
- double startTime(exec.uncheckedArgument(0).toNumber(&exec));
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
-
- double endTime(exec.uncheckedArgument(1).toNumber(&exec));
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
-
- ScriptExecutionContext* context = castedThis->scriptExecutionContext();
- if (!context)
- return throwConstructorScriptExecutionContextUnavailableError(exec, scope, "DataCue");
-
- String type;
-#if ENABLE(DATACUE_VALUE)
- if (exec.argumentCount() > 3) {
- if (!exec.uncheckedArgument(3).isString())
- return throwArgumentTypeError(exec, scope, 3, "type", "DataCue", nullptr, "DOMString");
- type = asString(exec.uncheckedArgument(3))->value(&exec);
- }
-#endif
-
- JSValue valueArgument = exec.uncheckedArgument(2);
- if (valueArgument.isUndefinedOrNull()) {
- setDOMException(&exec, TypeError);
- return JSValue::encode(JSValue());
- }
-
- if (valueArgument.isCell() && valueArgument.asCell()->inherits(std::remove_pointer<JSArrayBuffer*>::type::info())) {
-
- ArrayBuffer* data = ""
- RETURN_IF_EXCEPTION(scope, encodedJSValue());
-
- if (UNLIKELY(!data)) {
- setDOMException(&exec, TypeError);
- return JSValue::encode(jsUndefined());
- }
- return JSValue::encode(createWrapper<DataCue>(castedThis->globalObject(), DataCue::create(*context, MediaTime::createWithDouble(startTime), MediaTime::createWithDouble(endTime), *data, type)));
- }
-
-#if !ENABLE(DATACUE_VALUE)
- return JSValue::encode(jsUndefined());
-#else
- return JSValue::encode(createWrapper<DataCue>(castedThis->globalObject(), DataCue::create(*context, MediaTime::createWithDouble(startTime), MediaTime::createWithDouble(endTime), valueArgument, type)));
-#endif
-}
-
-} // namespace WebCore
-
-#endif
Modified: trunk/Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp (210024 => 210025)
--- trunk/Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp 2016-12-20 18:52:56 UTC (rev 210025)
@@ -57,7 +57,6 @@
JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<TextTrackCue>&& cue)
{
- // This switch will make more sense once we support DataCue
switch (cue->cueType()) {
case TextTrackCue::Data:
return createWrapper<DataCue>(globalObject, WTFMove(cue));
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (210024 => 210025)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-12-20 18:52:56 UTC (rev 210025)
@@ -5884,11 +5884,16 @@
}
push(@$outputArray, " RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $codeGenerator->ExtendedAttributeContains($interface->extendedAttributes->{ConstructorCallWith}, "ScriptState");
- if ($interface->extendedAttributes->{ConstructorMayThrowException}) {
- push(@$outputArray, " return JSValue::encode(toJSNewlyCreated(*state, *castedThis->globalObject(), throwScope, WTFMove(object)));\n");
- } else {
- push(@$outputArray, " return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));\n");
- }
+
+ my $IDLType = GetIDLType($interface, $interface->type);
+
+ my @constructionConversionArguments = ();
+ push(@constructionConversionArguments, "*state");
+ push(@constructionConversionArguments, "*castedThis->globalObject()");
+ push(@constructionConversionArguments, "throwScope") if $interface->extendedAttributes->{ConstructorMayThrowException};
+ push(@constructionConversionArguments, "WTFMove(object)");
+
+ push(@$outputArray, " return JSValue::encode(toJSNewlyCreated<${IDLType}>(" . join(", ", @constructionConversionArguments) . "));\n");
push(@$outputArray, "}\n\n");
}
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp (210024 => 210025)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp 2016-12-20 18:52:56 UTC (rev 210025)
@@ -129,7 +129,7 @@
auto eventInitDict = convert<IDLDictionary<TestEventConstructor::Init>>(*state, state->argument(1));
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto object = TestEventConstructor::create(WTFMove(type), WTFMove(eventInitDict));
- return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
+ return JSValue::encode(toJSNewlyCreated<IDLInterface<TestEventConstructor>>(*state, *castedThis->globalObject(), WTFMove(object)));
}
template<> JSValue JSTestEventConstructorConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (210024 => 210025)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp 2016-12-20 18:52:56 UTC (rev 210025)
@@ -234,7 +234,7 @@
if (UNLIKELY(!context))
return throwConstructorScriptExecutionContextUnavailableError(*state, throwScope, "TestInterface");
auto object = TestInterface::create(*context, WTFMove(str1), WTFMove(str2));
- return JSValue::encode(toJSNewlyCreated(*state, *castedThis->globalObject(), throwScope, WTFMove(object)));
+ return JSValue::encode(toJSNewlyCreated<IDLInterface<TestInterface>>(*state, *castedThis->globalObject(), throwScope, WTFMove(object)));
}
template<> JSValue JSTestInterfaceConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp (210024 => 210025)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp 2016-12-20 18:52:56 UTC (rev 210025)
@@ -96,7 +96,7 @@
auto str3 = state->argument(2).isUndefined() ? String() : convert<IDLDOMString>(*state, state->uncheckedArgument(2), StringConversionConfiguration::Normal);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto object = TestNamedConstructor::createForJSConstructor(*castedThis->document(), WTFMove(str1), WTFMove(str2), WTFMove(str3));
- return JSValue::encode(toJSNewlyCreated(*state, *castedThis->globalObject(), throwScope, WTFMove(object)));
+ return JSValue::encode(toJSNewlyCreated<IDLInterface<TestNamedConstructor>>(*state, *castedThis->globalObject(), throwScope, WTFMove(object)));
}
template<> JSValue JSTestNamedConstructorNamedConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp (210024 => 210025)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp 2016-12-20 18:52:56 UTC (rev 210025)
@@ -87,7 +87,7 @@
auto* castedThis = jsCast<JSTestNodeConstructor*>(state->jsCallee());
ASSERT(castedThis);
auto object = TestNode::create();
- return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
+ return JSValue::encode(toJSNewlyCreated<IDLInterface<TestNode>>(*state, *castedThis->globalObject(), WTFMove(object)));
}
template<> JSValue JSTestNodeConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (210024 => 210025)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-12-20 18:52:56 UTC (rev 210025)
@@ -1552,7 +1552,7 @@
ASSERT(context->isDocument());
auto& document = downcast<Document>(*context);
auto object = TestObj::create(document, testCallback.releaseNonNull(), testCallbackFunction.releaseNonNull());
- return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
+ return JSValue::encode(toJSNewlyCreated<IDLInterface<TestObj>>(*state, *castedThis->globalObject(), WTFMove(object)));
}
template<> JSValue JSTestObjConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (210024 => 210025)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp 2016-12-20 18:52:56 UTC (rev 210025)
@@ -77,7 +77,7 @@
auto arrayBuffer = convert<IDLInterface<ArrayBuffer>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "arrayBuffer", "TestOverloadedConstructors", nullptr, "ArrayBuffer"); });
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto object = TestOverloadedConstructors::create(*arrayBuffer);
- return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
+ return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*state, *castedThis->globalObject(), WTFMove(object)));
}
static inline EncodedJSValue constructJSTestOverloadedConstructors2(ExecState* state)
@@ -92,7 +92,7 @@
auto arrayBufferView = convert<IDLInterface<ArrayBufferView>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "arrayBufferView", "TestOverloadedConstructors", nullptr, "ArrayBufferView"); });
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto object = TestOverloadedConstructors::create(arrayBufferView.releaseNonNull());
- return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
+ return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*state, *castedThis->globalObject(), WTFMove(object)));
}
static inline EncodedJSValue constructJSTestOverloadedConstructors3(ExecState* state)
@@ -107,7 +107,7 @@
auto blob = convert<IDLInterface<Blob>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "blob", "TestOverloadedConstructors", nullptr, "Blob"); });
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto object = TestOverloadedConstructors::create(*blob);
- return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
+ return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*state, *castedThis->globalObject(), WTFMove(object)));
}
static inline EncodedJSValue constructJSTestOverloadedConstructors4(ExecState* state)
@@ -122,7 +122,7 @@
auto string = convert<IDLDOMString>(*state, state->uncheckedArgument(0), StringConversionConfiguration::Normal);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto object = TestOverloadedConstructors::create(WTFMove(string));
- return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
+ return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*state, *castedThis->globalObject(), WTFMove(object)));
}
static inline EncodedJSValue constructJSTestOverloadedConstructors5(ExecState* state)
@@ -135,7 +135,7 @@
auto longArgs = convertVariadicArguments<IDLLong>(*state, 0);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto object = TestOverloadedConstructors::create(WTFMove(longArgs));
- return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
+ return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*state, *castedThis->globalObject(), WTFMove(object)));
}
template<> EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::construct(ExecState* state)
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp (210024 => 210025)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp 2016-12-20 18:52:56 UTC (rev 210025)
@@ -75,7 +75,7 @@
auto sequenceOfStrings = state->argument(0).isUndefined() ? Converter<IDLSequence<IDLDOMString>>::ReturnType{ } : convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(sequenceOfStrings));
- return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
+ return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*state, *castedThis->globalObject(), WTFMove(object)));
}
static inline EncodedJSValue constructJSTestOverloadedConstructorsWithSequence2(ExecState* state)
@@ -90,7 +90,7 @@
auto string = convert<IDLDOMString>(*state, state->uncheckedArgument(0), StringConversionConfiguration::Normal);
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(string));
- return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
+ return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*state, *castedThis->globalObject(), WTFMove(object)));
}
template<> EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsWithSequenceConstructor::construct(ExecState* state)
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (210024 => 210025)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp 2016-12-20 18:52:56 UTC (rev 210025)
@@ -139,7 +139,7 @@
auto testCallbackInterface = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*state, state->uncheckedArgument(2), *castedThis->globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(state, scope, 2, "testCallbackInterface", "TestTypedefs", nullptr); });
RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
auto object = TestTypedefs::create(WTFMove(hello), testCallbackFunction.releaseNonNull(), testCallbackInterface.releaseNonNull());
- return JSValue::encode(toJSNewlyCreated(state, castedThis->globalObject(), WTFMove(object)));
+ return JSValue::encode(toJSNewlyCreated<IDLInterface<TestTypedefs>>(*state, *castedThis->globalObject(), WTFMove(object)));
}
template<> JSValue JSTestTypedefsConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
Modified: trunk/Source/WebCore/html/track/DataCue.cpp (210024 => 210025)
--- trunk/Source/WebCore/html/track/DataCue.cpp 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/html/track/DataCue.cpp 2016-12-20 18:52:56 UTC (rev 210025)
@@ -32,8 +32,11 @@
#include "Logging.h"
#include "TextTrack.h"
#include "TextTrackCueList.h"
+#include <runtime/JSCInlines.h>
#include <runtime/Protect.h>
+using namespace JSC;
+
namespace WebCore {
DataCue::DataCue(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, ArrayBuffer& data, const String& type)
@@ -45,11 +48,10 @@
DataCue::DataCue(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const void* data, unsigned length)
: TextTrackCue(context, start, end)
+ , m_data(ArrayBuffer::create(data, length))
{
- m_data = ArrayBuffer::create(data, length);
}
-#if ENABLE(DATACUE_VALUE)
DataCue::DataCue(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, RefPtr<SerializedPlatformRepresentation>&& platformValue, const String& type)
: TextTrackCue(context, start, end)
, m_type(type)
@@ -65,22 +67,17 @@
if (m_value)
JSC::gcProtect(m_value);
}
-#endif
DataCue::~DataCue()
{
-#if ENABLE(DATACUE_VALUE)
if (m_value)
JSC::gcUnprotect(m_value);
-#endif
}
RefPtr<ArrayBuffer> DataCue::data() const
{
-#if ENABLE(DATACUE_VALUE)
if (m_platformValue)
return m_platformValue->data();
-#endif
if (!m_data)
return nullptr;
@@ -90,12 +87,10 @@
void DataCue::setData(ArrayBuffer& data)
{
-#if ENABLE(DATACUE_VALUE)
m_platformValue = nullptr;
if (m_value)
JSC::gcUnprotect(m_value);
m_value = JSC::JSValue();
-#endif
m_data = ArrayBuffer::create(data);
}
@@ -126,7 +121,6 @@
if (m_data && m_data->data() && memcmp(m_data->data(), otherData->data(), m_data->byteLength()))
return false;
-#if ENABLE(DATACUE_VALUE)
const SerializedPlatformRepresentation* otherPlatformValue = dataCue->platformValue();
if ((otherPlatformValue && !m_platformValue) || (!otherPlatformValue && m_platformValue))
return false;
@@ -133,13 +127,12 @@
if (m_platformValue && !m_platformValue->isEqual(*otherPlatformValue))
return false;
- JSC::JSValue thisValue = value(nullptr);
- JSC::JSValue otherValue = dataCue->value(nullptr);
+ JSC::JSValue thisValue = valueOrNull();
+ JSC::JSValue otherValue = dataCue->valueOrNull();
if ((otherValue && !thisValue) || (!otherValue && thisValue))
return false;
if (!JSC::JSValue::strictEqual(nullptr, thisValue, otherValue))
return false;
-#endif
return true;
}
@@ -163,11 +156,10 @@
return TextTrackCue::doesExtendCue(cue);
}
-#if ENABLE(DATACUE_VALUE)
-JSC::JSValue DataCue::value(JSC::ExecState* exec) const
+JSC::JSValue DataCue::value(JSC::ExecState& state) const
{
- if (exec && m_platformValue)
- return m_platformValue->deserialize(exec);
+ if (m_platformValue)
+ return m_platformValue->deserialize(&state);
if (m_value)
return m_value;
@@ -175,7 +167,7 @@
return JSC::jsNull();
}
-void DataCue::setValue(JSC::ExecState*, JSC::JSValue value)
+void DataCue::setValue(JSC::ExecState&, JSC::JSValue value)
{
// FIXME: this should use a SerializedScriptValue.
if (m_value)
@@ -187,8 +179,15 @@
m_platformValue = nullptr;
m_data = nullptr;
}
-#endif
+JSValue DataCue::valueOrNull() const
+{
+ if (m_value)
+ return m_value;
+
+ return jsNull();
+}
+
} // namespace WebCore
#endif
Modified: trunk/Source/WebCore/html/track/DataCue.h (210024 => 210025)
--- trunk/Source/WebCore/html/track/DataCue.h 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/html/track/DataCue.h 2016-12-20 18:52:56 UTC (rev 210025)
@@ -28,15 +28,12 @@
#if ENABLE(VIDEO_TRACK)
+#include "SerializedPlatformRepresentation.h"
#include "TextTrackCue.h"
#include <runtime/ArrayBuffer.h>
-#include <runtime/JSCInlines.h>
+#include <runtime/JSCJSValue.h>
#include <wtf/MediaTime.h>
-#if ENABLE(DATACUE_VALUE)
-#include "SerializedPlatformRepresentation.h"
-#endif
-
namespace WebCore {
class ScriptExecutionContext;
@@ -58,53 +55,50 @@
return adoptRef(*new DataCue(context, start, end, data, type));
}
-#if ENABLE(DATACUE_VALUE)
static Ref<DataCue> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, RefPtr<SerializedPlatformRepresentation>&& platformValue, const String& type)
{
return adoptRef(*new DataCue(context, start, end, WTFMove(platformValue), type));
}
- static Ref<DataCue> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, JSC::JSValue value, const String& type)
+ static Ref<DataCue> create(ScriptExecutionContext& context, double start, double end, ArrayBuffer& data)
{
- return adoptRef(*new DataCue(context, start, end, value, type));
+ return adoptRef(*new DataCue(context, MediaTime::createWithDouble(start), MediaTime::createWithDouble(end), data, emptyString()));
}
-#endif
+ static Ref<DataCue> create(ScriptExecutionContext& context, double start, double end, JSC::JSValue value, const String& type)
+ {
+ return adoptRef(*new DataCue(context, MediaTime::createWithDouble(start), MediaTime::createWithDouble(end), value, type));
+ }
virtual ~DataCue();
CueType cueType() const override { return Data; }
- RefPtr<ArrayBuffer> data() const;
- void setData(ArrayBuffer&);
+ RefPtr<JSC::ArrayBuffer> data() const;
+ void setData(JSC::ArrayBuffer&);
-#if ENABLE(DATACUE_VALUE)
const SerializedPlatformRepresentation* platformValue() const { return m_platformValue.get(); }
- JSC::JSValue value(JSC::ExecState*) const;
- void setValue(JSC::ExecState*, JSC::JSValue);
+ JSC::JSValue value(JSC::ExecState&) const;
+ void setValue(JSC::ExecState&, JSC::JSValue);
String type() const { return m_type; }
void setType(const String& type) { m_type = type; }
-#endif
bool isEqual(const TextTrackCue&, CueMatchRules) const override;
bool cueContentsMatch(const TextTrackCue&) const override;
bool doesExtendCue(const TextTrackCue&) const override;
-protected:
+private:
DataCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, ArrayBuffer&, const String&);
DataCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, const void*, unsigned);
-#if ENABLE(DATACUE_VALUE)
DataCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, RefPtr<SerializedPlatformRepresentation>&&, const String&);
DataCue(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, JSC::JSValue, const String&);
-#endif
-private:
+ JSC::JSValue valueOrNull() const;
+
RefPtr<ArrayBuffer> m_data;
String m_type;
-#if ENABLE(DATACUE_VALUE)
RefPtr<SerializedPlatformRepresentation> m_platformValue;
JSC::JSValue m_value;
-#endif
};
DataCue* toDataCue(TextTrackCue*);
Modified: trunk/Source/WebCore/html/track/DataCue.idl (210024 => 210025)
--- trunk/Source/WebCore/html/track/DataCue.idl 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/html/track/DataCue.idl 2016-12-20 18:52:56 UTC (rev 210025)
@@ -23,21 +23,16 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
[
Conditional=VIDEO_TRACK,
- CustomConstructor,
-#if defined(ENABLE_DATACUE_VALUE) && ENABLE_DATACUE_VALUE
- CustomConstructor(unrestricted double startTime, unrestricted double endTime, any value, optional DOMString type),
- InterfaceName=WebKitDataCue,
-#else
- CustomConstructor(unrestricted double startTime, unrestricted double endTime, ArrayBuffer data),
-#endif
- ConstructorMayThrowException,
+ Constructor(unrestricted double startTime, unrestricted double endTime, ArrayBuffer data),
+ Constructor(unrestricted double startTime, unrestricted double endTime, any value, optional DOMString type),
+ ConstructorCallWith=ScriptExecutionContext
] interface DataCue : TextTrackCue {
attribute ArrayBuffer data;
-#if defined(ENABLE_DATACUE_VALUE) && ENABLE_DATACUE_VALUE
- [CustomGetter, CustomSetter] attribute any value;
+ // Proposed extensions.
+ [CallWith=ScriptState] attribute any value;
readonly attribute DOMString type;
-#endif
};
Modified: trunk/Source/WebCore/platform/SerializedPlatformRepresentation.h (210024 => 210025)
--- trunk/Source/WebCore/platform/SerializedPlatformRepresentation.h 2016-12-20 18:44:38 UTC (rev 210024)
+++ trunk/Source/WebCore/platform/SerializedPlatformRepresentation.h 2016-12-20 18:52:56 UTC (rev 210025)
@@ -23,10 +23,9 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SerializedPlatformRepresentation_h
-#define SerializedPlatformRepresentation_h
+#pragma once
-#if ENABLE(VIDEO) && ENABLE(DATACUE_VALUE)
+#if ENABLE(VIDEO)
#include <runtime/JSCInlines.h>
#include <wtf/RefCounted.h>
@@ -38,7 +37,7 @@
virtual ~SerializedPlatformRepresentation() { }
virtual JSC::JSValue deserialize(JSC::ExecState*) const = 0;
- virtual RefPtr<ArrayBuffer> data() const = 0;
+ virtual RefPtr<JSC::ArrayBuffer> data() const = 0;
virtual bool isEqual(const SerializedPlatformRepresentation&) const = 0;
enum PlatformType {
@@ -53,5 +52,3 @@
} // namespace WebCore
#endif
-#endif // SerializedPlatformRepresentation_h
-