Title: [207462] trunk/Source/WebCore
Revision
207462
Author
zandober...@gmail.com
Date
2016-10-18 06:15:40 -0700 (Tue, 18 Oct 2016)

Log Message

[WebIDL] Support BufferSource
https://bugs.webkit.org/show_bug.cgi?id=163541

Reviewed by Youenn Fablet.

Add support for the BufferSource typedef in WebIDL. The implementation
adds the necessary handling for this type in the generator scripts and
the specialization of the Converter<> template for the IDLBufferSource
struct that enables exposing ArrayBuffer or ArrayBufferView objects by
having WebCore::BufferSource objects pointing to their data.

The SourceBuffer interface in the MSE module has the appendBuffer()
operation modified to accept a BufferSource parameter, instead of
overloading it for ArrayBuffer and ArrayBufferView parameters.

The bindings generator tests cover BufferSource as both an operation
parameter and as a dictionary member.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBuffer):
(WebCore::SourceBuffer::appendBufferInternal):
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBuffer.idl:
* WebCore.xcodeproj/project.pbxproj:
* bindings/generic/IDLTypes.h:
* bindings/js/BufferSource.h: Added.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLBufferSource>::convert):
* bindings/scripts/CodeGenerator.pm:
(SkipIncludeHeader):
(IsWrapperType):
* bindings/scripts/CodeGeneratorJS.pm:
(AddClassForwardIfNeeded):
(GetBaseIDLType):
(IsHandledByDOMConvert):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::jsTestObjPrototypeFunctionBufferSourceParameter):
(WebCore::jsTestObjPrototypeFunctionBufferSourceParameterCaller):
* bindings/scripts/test/TestObj.idl:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (207461 => 207462)


--- trunk/Source/WebCore/ChangeLog	2016-10-18 12:51:33 UTC (rev 207461)
+++ trunk/Source/WebCore/ChangeLog	2016-10-18 13:15:40 UTC (rev 207462)
@@ -1,3 +1,46 @@
+2016-10-18  Zan Dobersek  <zdober...@igalia.com>
+
+        [WebIDL] Support BufferSource
+        https://bugs.webkit.org/show_bug.cgi?id=163541
+
+        Reviewed by Youenn Fablet.
+
+        Add support for the BufferSource typedef in WebIDL. The implementation
+        adds the necessary handling for this type in the generator scripts and
+        the specialization of the Converter<> template for the IDLBufferSource
+        struct that enables exposing ArrayBuffer or ArrayBufferView objects by
+        having WebCore::BufferSource objects pointing to their data.
+
+        The SourceBuffer interface in the MSE module has the appendBuffer()
+        operation modified to accept a BufferSource parameter, instead of
+        overloading it for ArrayBuffer and ArrayBufferView parameters.
+
+        The bindings generator tests cover BufferSource as both an operation
+        parameter and as a dictionary member.
+
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::appendBuffer):
+        (WebCore::SourceBuffer::appendBufferInternal):
+        * Modules/mediasource/SourceBuffer.h:
+        * Modules/mediasource/SourceBuffer.idl:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/generic/IDLTypes.h:
+        * bindings/js/BufferSource.h: Added.
+        * bindings/js/JSDOMConvert.h:
+        (WebCore::Converter<IDLBufferSource>::convert):
+        * bindings/scripts/CodeGenerator.pm:
+        (SkipIncludeHeader):
+        (IsWrapperType):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (AddClassForwardIfNeeded):
+        (GetBaseIDLType):
+        (IsHandledByDOMConvert):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::convertDictionary<TestObj::Dictionary>):
+        (WebCore::jsTestObjPrototypeFunctionBufferSourceParameter):
+        (WebCore::jsTestObjPrototypeFunctionBufferSourceParameterCaller):
+        * bindings/scripts/test/TestObj.idl:
+
 2016-10-18  Javier Fernandez  <jfernan...@igalia.com>
 
         [css-grid] Different width of grid container between initial load and refresh

Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (207461 => 207462)


--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2016-10-18 12:51:33 UTC (rev 207461)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2016-10-18 13:15:40 UTC (rev 207462)
@@ -35,6 +35,7 @@
 #if ENABLE(MEDIA_SOURCE)
 
 #include "AudioTrackList.h"
+#include "BufferSource.h"
 #include "Event.h"
 #include "EventNames.h"
 #include "ExceptionCodePlaceholder.h"
@@ -231,17 +232,11 @@
     return { };
 }
 
-
-ExceptionOr<void> SourceBuffer::appendBuffer(ArrayBuffer& data)
+ExceptionOr<void> SourceBuffer::appendBuffer(const BufferSource& data)
 {
-    return appendBufferInternal(static_cast<unsigned char*>(data.data()), data.byteLength());
+    return appendBufferInternal(static_cast<const unsigned char*>(data.data), data.length);
 }
 
-ExceptionOr<void> SourceBuffer::appendBuffer(ArrayBufferView& data)
-{
-    return appendBufferInternal(static_cast<unsigned char*>(data.baseAddress()), data.byteLength());
-}
-
 void SourceBuffer::resetParserState()
 {
     // Section 3.5.2 Reset Parser State algorithm steps.
@@ -496,7 +491,7 @@
     m_asyncEventQueue.enqueueEvent(WTFMove(event));
 }
 
-ExceptionOr<void> SourceBuffer::appendBufferInternal(unsigned char* data, unsigned size)
+ExceptionOr<void> SourceBuffer::appendBufferInternal(const unsigned char* data, unsigned size)
 {
     // Section 3.2 appendBuffer()
     // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data

Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h (207461 => 207462)


--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h	2016-10-18 12:51:33 UTC (rev 207461)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h	2016-10-18 13:15:40 UTC (rev 207462)
@@ -47,6 +47,7 @@
 namespace WebCore {
 
 class AudioTrackList;
+class BufferSource;
 class MediaSource;
 class PlatformTimeRanges;
 class TextTrackList;
@@ -74,8 +75,7 @@
     double appendWindowEnd() const;
     ExceptionOr<void> setAppendWindowEnd(double);
 
-    ExceptionOr<void> appendBuffer(ArrayBuffer&);
-    ExceptionOr<void> appendBuffer(ArrayBufferView&);
+    ExceptionOr<void> appendBuffer(const BufferSource&);
     ExceptionOr<void> abort();
     ExceptionOr<void> remove(double start, double end);
     ExceptionOr<void> remove(const MediaTime&, const MediaTime&);
@@ -150,7 +150,7 @@
     bool isRemoved() const;
     void scheduleEvent(const AtomicString& eventName);
 
-    ExceptionOr<void> appendBufferInternal(unsigned char*, unsigned);
+    ExceptionOr<void> appendBufferInternal(const unsigned char*, unsigned);
     void appendBufferTimerFired();
     void resetParserState();
 

Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl (207461 => 207462)


--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl	2016-10-18 12:51:33 UTC (rev 207461)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl	2016-10-18 13:15:40 UTC (rev 207462)
@@ -57,8 +57,7 @@
     [SetterMayThrowException] attribute unrestricted double appendWindowEnd;
 
     // Append segment data.
-    [MayThrowException] void appendBuffer(ArrayBuffer data);
-    [MayThrowException] void appendBuffer(ArrayBufferView data);
+    [MayThrowException] void appendBuffer(BufferSource data);
 
     // Abort the current segment append sequence.
     [MayThrowException] void abort();

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (207461 => 207462)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-10-18 12:51:33 UTC (rev 207461)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-10-18 13:15:40 UTC (rev 207462)
@@ -1256,6 +1256,7 @@
 		2DE70023192FE82A00B0975C /* DisplayRefreshMonitorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DE70022192FE82A00B0975C /* DisplayRefreshMonitorMac.h */; };
 		2DF512CD1D873E47001D6780 /* ReplaceRangeWithTextCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DF512CB1D873E47001D6780 /* ReplaceRangeWithTextCommand.cpp */; };
 		2DF512CE1D873E47001D6780 /* ReplaceRangeWithTextCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DF512CC1D873E47001D6780 /* ReplaceRangeWithTextCommand.h */; };
+		2DFA488F1DB541D000362B99 /* BufferSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DFA488E1DB541C200362B99 /* BufferSource.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		2E0888D41148848A00AF4265 /* JSDOMFormData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */; };
 		2E0888D51148848A00AF4265 /* JSDOMFormData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E0888D31148848A00AF4265 /* JSDOMFormData.h */; };
 		2E19516B1B6598D200DF6EEF /* WheelEventDeltaFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E19516A1B6598D200DF6EEF /* WheelEventDeltaFilter.cpp */; };
@@ -5974,6 +5975,7 @@
 		E125F83A1824104800D84CD9 /* CryptoAlgorithmAesCbcParamsDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F8391824104800D84CD9 /* CryptoAlgorithmAesCbcParamsDeprecated.h */; };
 		E125F83D182411E700D84CD9 /* JSCryptoOperationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F83B182411E700D84CD9 /* JSCryptoOperationData.cpp */; };
 		E125F83E182411E700D84CD9 /* JSCryptoOperationData.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F83C182411E700D84CD9 /* JSCryptoOperationData.h */; };
+
 		E125F8411824253A00D84CD9 /* CryptoAlgorithmAES_CBC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F83F1824253A00D84CD9 /* CryptoAlgorithmAES_CBC.cpp */; };
 		E125F8421824253A00D84CD9 /* CryptoAlgorithmAES_CBC.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F8401824253A00D84CD9 /* CryptoAlgorithmAES_CBC.h */; };
 		E125F845182425C900D84CD9 /* CryptoAlgorithmAES_CBCMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F843182425C900D84CD9 /* CryptoAlgorithmAES_CBCMac.cpp */; };
@@ -8235,6 +8237,7 @@
 		2DE70022192FE82A00B0975C /* DisplayRefreshMonitorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayRefreshMonitorMac.h; sourceTree = "<group>"; };
 		2DF512CB1D873E47001D6780 /* ReplaceRangeWithTextCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReplaceRangeWithTextCommand.cpp; sourceTree = "<group>"; };
 		2DF512CC1D873E47001D6780 /* ReplaceRangeWithTextCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplaceRangeWithTextCommand.h; sourceTree = "<group>"; };
+		2DFA488E1DB541C200362B99 /* BufferSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BufferSource.h; sourceTree = "<group>"; };
 		2E0888C3114883A900AF4265 /* DOMFormData.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMFormData.idl; sourceTree = "<group>"; };
 		2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMFormData.cpp; sourceTree = "<group>"; };
 		2E0888D31148848A00AF4265 /* JSDOMFormData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMFormData.h; sourceTree = "<group>"; };
@@ -21415,6 +21418,7 @@
 				14DFB33F0A7DF7630018F769 /* Derived Sources */,
 				49B3760A15C6C6840059131D /* ArrayValue.cpp */,
 				49B3760B15C6C6840059131D /* ArrayValue.h */,
+				2DFA488E1DB541C200362B99 /* BufferSource.h */,
 				BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */,
 				93F8B3060A300FEA00F61AB8 /* CodeGeneratorJS.pm */,
 				312D67B01535691F00563D0D /* Dictionary.cpp */,
@@ -26798,6 +26802,7 @@
 				0FC4E40D187F82E10045882C /* ScrollingCoordinatorIOS.h in Headers */,
 				9391A991162746CB00297330 /* ScrollingCoordinatorMac.h in Headers */,
 				93C38BFF164473C700091EB2 /* ScrollingStateFixedNode.h in Headers */,
+				2DFA488F1DB541D000362B99 /* BufferSource.h in Headers */,
 				0FEA3E7B191B2FC5000F1B55 /* ScrollingStateFrameScrollingNode.h in Headers */,
 				931CBD0D161A44E900E4C874 /* ScrollingStateNode.h in Headers */,
 				0FEA3E84191B31BF000F1B55 /* ScrollingStateOverflowScrollingNode.h in Headers */,

Modified: trunk/Source/WebCore/bindings/generic/IDLTypes.h (207461 => 207462)


--- trunk/Source/WebCore/bindings/generic/IDLTypes.h	2016-10-18 12:51:33 UTC (rev 207461)
+++ trunk/Source/WebCore/bindings/generic/IDLTypes.h	2016-10-18 13:15:40 UTC (rev 207462)
@@ -35,6 +35,7 @@
 
 namespace WebCore {
 
+class BufferSource;
 template <typename Value> class DOMPromise;
 
 template<typename T>
@@ -118,6 +119,7 @@
     using TypeList = brigand::list<Ts...>;
 };
 
+struct IDLBufferSource : IDLType<BufferSource> { };
 
 // Helper predicates
 

Added: trunk/Source/WebCore/bindings/js/BufferSource.h (0 => 207462)


--- trunk/Source/WebCore/bindings/js/BufferSource.h	                        (rev 0)
+++ trunk/Source/WebCore/bindings/js/BufferSource.h	2016-10-18 13:15:40 UTC (rev 207462)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 Igalia S.L.
+ *
+ * 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
+
+namespace WebCore {
+
+class BufferSource {
+public:
+    const uint8_t* data;
+    size_t length;
+};
+
+} // namespace WebCore

Modified: trunk/Source/WebCore/bindings/js/JSDOMConvert.h (207461 => 207462)


--- trunk/Source/WebCore/bindings/js/JSDOMConvert.h	2016-10-18 12:51:33 UTC (rev 207461)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvert.h	2016-10-18 13:15:40 UTC (rev 207462)
@@ -25,6 +25,7 @@
 
 #pragma once
 
+#include "BufferSource.h"
 #include "IDLTypes.h"
 #include "JSDOMBinding.h"
 
@@ -638,4 +639,25 @@
     return { length, WTFMove(result) };
 }
 
+// MARK: -
+// MARK: BufferSource type
+
+template<> struct Converter<IDLBufferSource> : DefaultConverter<IDLBufferSource> {
+    using ReturnType = BufferSource;
+
+    static ReturnType convert(JSC::ExecState& state, JSC::JSValue value)
+    {
+        JSC::VM& vm = state.vm();
+        auto scope = DECLARE_THROW_SCOPE(vm);
+
+        if (JSC::ArrayBuffer* buffer = JSC::toArrayBuffer(value))
+            return { static_cast<uint8_t*>(buffer->data()), buffer->byteLength() };
+        if (RefPtr<JSC::ArrayBufferView> bufferView = toArrayBufferView(value))
+            return { static_cast<uint8_t*>(bufferView->baseAddress()), bufferView->byteLength() };
+
+        throwTypeError(&state, scope, ASCIILiteral("Only ArrayBuffer and ArrayBufferView objects can be passed as BufferSource arguments"));
+        return { nullptr, 0 };
+    }
+};
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (207461 => 207462)


--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm	2016-10-18 12:51:33 UTC (rev 207461)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm	2016-10-18 13:15:40 UTC (rev 207462)
@@ -371,6 +371,7 @@
     return 1 if $object->IsPrimitiveType($type);
     return 1 if $object->IsTypedArrayType($type);
     return 1 if $type eq "Array";
+    return 1 if $type eq "BufferSource";
     return 1 if $type eq "DOMString" or $type eq "USVString";
     return 1 if $type eq "DOMTimeStamp";
     return 1 if $type eq "SVGNumber";
@@ -866,6 +867,7 @@
 
     return 0 if !$object->IsRefPtrType($type);
     return 0 if $object->IsTypedArrayType($type);
+    return 0 if $type eq "BufferSource";
     return 0 if $type eq "UNION";
     return 0 if $webCoreTypeHash{$type};
 

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (207461 => 207462)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-10-18 12:51:33 UTC (rev 207461)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-10-18 13:15:40 UTC (rev 207462)
@@ -319,7 +319,9 @@
 
     # SVGAnimatedLength/Number/etc. are not classes so they can't be forward declared as classes.
     return if $codeGenerator->IsSVGAnimatedType($interfaceName);
+
     return if $codeGenerator->IsTypedArrayType($interfaceName);
+    return if $interfaceName eq "BufferSource";
 
     push(@headerContent, "class $interfaceName;\n\n");
 }
@@ -4993,6 +4995,7 @@
     return "IDLSequence<" . GetIDLType($interface, @{$idlType->subtypes}[0]) . ">" if $codeGenerator->IsSequenceType($idlType->name);
     return "IDLFrozenArray<" . GetIDLType($interface, @{$idlType->subtypes}[0]) . ">" if $codeGenerator->IsFrozenArrayType($idlType->name);
     return "IDLUnion<" . join(", ", GetIDLUnionMemberTypes($interface, $idlType)) . ">" if $idlType->isUnion;
+    return "IDLBufferSource" if $idlType->name eq "BufferSource";
     return "IDLInterface<" . $idlType->name . ">";
 }
 
@@ -5114,6 +5117,7 @@
     my $idlType = shift;
 
     return 1 if $idlType->isUnion;
+    return 1 if $idlType->name eq "BufferSource";
     return 1 if $idlType->name eq "any";
     return 1 if $idlType->name eq "boolean";
     return 1 if $codeGenerator->IsIntegerType($idlType->name);

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (207461 => 207462)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-10-18 12:51:33 UTC (rev 207461)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-10-18 13:15:40 UTC (rev 207462)
@@ -503,6 +503,11 @@
         result.booleanWithoutDefault = convert<IDLBoolean>(state, booleanWithoutDefaultValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
+    JSValue bufferSourceValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "bufferSourceValue"));
+    if (!bufferSourceValueValue.isUndefined()) {
+        result.bufferSourceValue = convert<IDLBufferSource>(state, bufferSourceValueValue);
+        RETURN_IF_EXCEPTION(throwScope, Nullopt);
+    }
     JSValue dictionaryMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "dictionaryMember"));
     if (!dictionaryMemberValue.isUndefined()) {
         auto dictionaryMemberOptional = convert<IDLDictionary<TestObj::DictionaryThatShouldTolerateNull>>(state, dictionaryMemberValue);
@@ -993,6 +998,7 @@
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSingleConditionalOverload(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAttachShadowRoot(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameter(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionBufferSourceParameter(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionToString(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionToJSON(JSC::ExecState*);
 
@@ -1604,6 +1610,7 @@
     { "singleConditionalOverload", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionSingleConditionalOverload), (intptr_t) (1) } },
     { "attachShadowRoot", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAttachShadowRoot), (intptr_t) (1) } },
     { "operationWithExternalDictionaryParameter", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameter), (intptr_t) (1) } },
+    { "bufferSourceParameter", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionBufferSourceParameter), (intptr_t) (1) } },
     { "toString", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionToString), (intptr_t) (0) } },
     { "toJSON", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionToJSON), (intptr_t) (0) } },
 #if ENABLE(Condition1)
@@ -7729,6 +7736,26 @@
     return JSValue::encode(jsUndefined());
 }
 
+static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionBufferSourceParameterCaller(JSC::ExecState*, JSTestObj*, JSC::ThrowScope&);
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionBufferSourceParameter(ExecState* state)
+{
+    return BindingCaller<JSTestObj>::callOperation<jsTestObjPrototypeFunctionBufferSourceParameterCaller>(state, "bufferSourceParameter");
+}
+
+static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionBufferSourceParameterCaller(JSC::ExecState* state, JSTestObj* castedThis, JSC::ThrowScope& throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto& impl = castedThis->wrapped();
+    if (UNLIKELY(state->argumentCount() < 1))
+        return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
+    auto data = "" state->uncheckedArgument(0));
+    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
+    impl.bufferSourceParameter(WTFMove(data));
+    return JSValue::encode(jsUndefined());
+}
+
 static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionToStringCaller(JSC::ExecState*, JSTestObj*, JSC::ThrowScope&);
 
 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionToString(ExecState* state)

Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (207461 => 207462)


--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2016-10-18 12:51:33 UTC (rev 207461)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2016-10-18 13:15:40 UTC (rev 207462)
@@ -415,6 +415,8 @@
     stringifier attribute USVString stringifierAttribute;
 
     serializer = {create, readOnlyStringAttr, enumAttr, longAttr};
+
+    void bufferSourceParameter(BufferSource data);
 };
 
 // The following comment should not generate any code.
@@ -460,6 +462,7 @@
     TestDictionaryThatShouldTolerateNull dictionaryMember;
     (long or Node) unionMember;
     (long or Node)? nullableUnionMember = null;
+    BufferSource bufferSourceValue;
 };
 
 dictionary TestDictionaryThatShouldNotTolerateNull {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to