[Streams API] Create ByteLengthQueuingStrategy object as per spec
authorcalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Oct 2015 07:38:52 +0000 (07:38 +0000)
committercalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Oct 2015 07:38:52 +0000 (07:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147153

Reviewed by Darin Adler.

Source/WebCore:

Added ByteLengthQueuingStream class as the spec defines at https://streams.spec.whatwg.org/#blqs-class.

Tests are covered by current set.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreJSBuiltins.cpp: Added build instructions.
* Modules/streams/ByteLengthQueuingStrategy.idl: Added.
* Modules/streams/ByteLengthQueuingStrategy.js: Copied from Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp.
(size): Return byteLength attribute of the chunk.
(initializeByteLengthQueuingStrategy): Initialize the highWaterMark property.
* bindings/js/WebCoreJSClientData.h:
(WebCore::WebCoreJSClientData::WebCoreJSClientData): Initialize the blqs builtins.
(WebCore::WebCoreJSClientData::byteLengthQueuingStrategyBuiltins): Return the attribute.

LayoutTests:

* js/dom/global-constructors-attributes-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt: Added ByteLengthQueuingStrategy to the
constructor expectations.
* streams/reference-implementation/brand-checks.html:
* streams/reference-implementation/byte-length-queuing-strategy.html: Removed reference to
byte-length-queuing-strategy.js as it should be now builtin in WebKit.
* streams/reference-implementation/resources/byte-length-queuing-strategy.js: Removed.
(ByteLengthQueuingStrategy): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190394 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
LayoutTests/ChangeLog
LayoutTests/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt
LayoutTests/streams/reference-implementation/brand-checks.html
LayoutTests/streams/reference-implementation/byte-length-queuing-strategy.html
LayoutTests/streams/reference-implementation/resources/byte-length-queuing-strategy.js [deleted file]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/streams/ByteLengthQueuingStrategy.idl [new file with mode: 0644]
Source/WebCore/Modules/streams/ByteLengthQueuingStrategy.js [new file with mode: 0644]
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp
Source/WebCore/bindings/js/WebCoreJSClientData.h

index 7817aa2..6073b9a 100644 (file)
@@ -1,3 +1,24 @@
+2015-10-01  Xabier Rodriguez Calvar  <calvaris@igalia.com>
+
+        [Streams API] Create ByteLengthQueuingStrategy object as per spec
+        https://bugs.webkit.org/show_bug.cgi?id=147153
+
+        Reviewed by Darin Adler.
+
+        * js/dom/global-constructors-attributes-expected.txt:
+        * platform/efl/js/dom/global-constructors-attributes-expected.txt:
+        * platform/gtk/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac/js/dom/global-constructors-attributes-expected.txt:
+        * platform/win/js/dom/global-constructors-attributes-expected.txt: Added ByteLengthQueuingStrategy to the
+        constructor expectations.
+        * streams/reference-implementation/brand-checks.html:
+        * streams/reference-implementation/byte-length-queuing-strategy.html: Removed reference to
+        byte-length-queuing-strategy.js as it should be now builtin in WebKit.
+        * streams/reference-implementation/resources/byte-length-queuing-strategy.js: Removed.
+        (ByteLengthQueuingStrategy): Deleted.
+
 2015-09-30  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r190367 and r190373.
index d94c2c8..982d195 100644 (file)
@@ -83,6 +83,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('get') is fa
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').value is ByteLengthQueuingStrategy
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').value is CDATASection
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
index 8bf6227..9bc3bd9 100644 (file)
@@ -88,6 +88,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('get') is fa
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').value is ByteLengthQueuingStrategy
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').value is CDATASection
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
index f98f3f1..f1f84a0 100644 (file)
@@ -88,6 +88,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('get') is fa
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').value is ByteLengthQueuingStrategy
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').value is CDATASection
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
index 0a32175..257d9b4 100644 (file)
@@ -83,6 +83,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('get') is fa
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').value is ByteLengthQueuingStrategy
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').value is CDATASection
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
index ab822de..134d847 100644 (file)
@@ -83,6 +83,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('get') is fa
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').value is ByteLengthQueuingStrategy
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').value is CDATASection
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
index 858c7ac..1764374 100644 (file)
@@ -83,6 +83,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('get') is fa
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').value is ByteLengthQueuingStrategy
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').value is CDATASection
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
index 1fe0bbc..bcb4a23 100644 (file)
@@ -38,6 +38,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('get') is fa
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'Blob').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').value is ByteLengthQueuingStrategy
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'ByteLengthQueuingStrategy').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').value is CDATASection
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CDATASection').hasOwnProperty('set') is false
index 772b11e..de0478f 100644 (file)
@@ -2,7 +2,6 @@
 <script src='../../resources/testharness.js'></script>
 <script src='../../resources/testharnessreport.js'></script>
 <script src='resources/streams-utils.js'></script>
-<script src='resources/byte-length-queuing-strategy.js'></script>
 <script>
 // This is updated till https://github.com/whatwg/streams/commit/ec5ffa036308d9f6350d2946560d48cdbf090939
 
index a99c581..4fadb64 100644 (file)
@@ -2,7 +2,6 @@
 <script src='../../resources/testharness.js'></script>
 <script src='../../resources/testharnessreport.js'></script>
 <script src='resources/streams-utils.js'></script>
-<script src='resources/byte-length-queuing-strategy.js'></script>
 <script>
 // This is updated till https://github.com/whatwg/streams/commit/ec5ffa036308d9f6350d2946560d48cdbf090939
 
diff --git a/LayoutTests/streams/reference-implementation/resources/byte-length-queuing-strategy.js b/LayoutTests/streams/reference-implementation/resources/byte-length-queuing-strategy.js
deleted file mode 100644 (file)
index b1c7453..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// FIXME: Remove this file when implemented in WebCore.
-
-function ByteLengthQueuingStrategy({ highWaterMark }) {
-    createDataProperty(this, 'highWaterMark', highWaterMark);
-}
-
-ByteLengthQueuingStrategy.prototype = {
-    size: function(chunk) {
-        return chunk.byteLength;
-    }
-}
index 0ff0b0a..2bfbe9e 100644 (file)
@@ -276,6 +276,7 @@ set(WebCore_NON_SVG_IDL_FILES
     Modules/speech/SpeechSynthesisUtterance.idl
     Modules/speech/SpeechSynthesisVoice.idl
 
+    Modules/streams/ByteLengthQueuingStrategy.idl
     Modules/streams/CountQueuingStrategy.idl
     Modules/streams/ReadableStream.idl
     Modules/streams/ReadableStreamController.idl
@@ -3351,6 +3352,7 @@ set(DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE ${DERIVED_SOURCES_WEBCORE_DIR}/
 set(IDL_ATTRIBUTES_FILE ${WEBCORE_DIR}/bindings/scripts/IDLAttributes.txt)
 
 set(WEBCORE_JS_BUILTINS
+    ${WEBCORE_DIR}/Modules/streams/ByteLengthQueuingStrategy.js
     ${WEBCORE_DIR}/Modules/streams/CountQueuingStrategy.js
     ${WEBCORE_DIR}/Modules/streams/ReadableStream.js
 )
index fffcc16..d02f264 100644 (file)
@@ -1,3 +1,29 @@
+2015-10-01  Xabier Rodriguez Calvar  <calvaris@igalia.com>
+
+        [Streams API] Create ByteLengthQueuingStrategy object as per spec
+        https://bugs.webkit.org/show_bug.cgi?id=147153
+
+        Reviewed by Darin Adler.
+
+        Added ByteLengthQueuingStream class as the spec defines at https://streams.spec.whatwg.org/#blqs-class.
+
+        Tests are covered by current set.
+
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/WebCoreJSBuiltins.cpp: Added build instructions.
+        * Modules/streams/ByteLengthQueuingStrategy.idl: Added.
+        * Modules/streams/ByteLengthQueuingStrategy.js: Copied from Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp.
+        (size): Return byteLength attribute of the chunk.
+        (initializeByteLengthQueuingStrategy): Initialize the highWaterMark property.
+        * bindings/js/WebCoreJSClientData.h:
+        (WebCore::WebCoreJSClientData::WebCoreJSClientData): Initialize the blqs builtins.
+        (WebCore::WebCoreJSClientData::byteLengthQueuingStrategyBuiltins): Return the attribute.
+
 2015-10-01  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
 
         Clean up all uses of PassRefPtr in Modules/geolocation
index 12c2db9..4b2d104 100644 (file)
@@ -42,6 +42,7 @@
 #include "JSCanvasRenderingContext.cpp"
 #include "JSCanvasRenderingContext2D.cpp"
 #if ENABLE(STREAMS_API)
+#include "JSByteLengthQueuingStrategy.cpp"
 #include "JSCountQueuingStrategy.cpp"
 #endif
 #if ENABLE(WEBGL)
index 5c4d060..03580b5 100644 (file)
@@ -174,6 +174,7 @@ NON_SVG_BINDING_IDLS = \
     $(WebCore)/Modules/speech/SpeechSynthesisEvent.idl \
     $(WebCore)/Modules/speech/SpeechSynthesisUtterance.idl \
     $(WebCore)/Modules/speech/SpeechSynthesisVoice.idl \
+    $(WebCore)/Modules/streams/ByteLengthQueuingStrategy.idl \
     $(WebCore)/Modules/streams/CountQueuingStrategy.idl \
     $(WebCore)/Modules/streams/ReadableStream.idl \
     $(WebCore)/Modules/streams/ReadableStreamController.idl \
@@ -1249,6 +1250,7 @@ WebReplayInputs.h : $(INPUT_GENERATOR_SPECIFICATIONS) $(INPUT_GENERATOR_SCRIPTS)
 # WebCore JS Builtins
 
 WEBCORE_JS_BUILTINS = \
+    $(WebCore)/Modules/streams/ByteLengthQueuingStrategy.js \
     $(WebCore)/Modules/streams/CountQueuingStrategy.js \
     $(WebCore)/Modules/streams/ReadableStream.js \
 #
diff --git a/Source/WebCore/Modules/streams/ByteLengthQueuingStrategy.idl b/Source/WebCore/Modules/streams/ByteLengthQueuingStrategy.idl
new file mode 100644 (file)
index 0000000..88a29c5
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2015 Canon Inc.
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be 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.
+ * 3.  Neither the name of Canon Inc. nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CANON 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 CANON INC. AND 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.
+ */
+
+[
+    JSBuiltinConstructor,
+    Conditional=STREAMS_API,
+] interface ByteLengthQueuingStrategy {
+    [JSBuiltin] double size();
+};
diff --git a/Source/WebCore/Modules/streams/ByteLengthQueuingStrategy.js b/Source/WebCore/Modules/streams/ByteLengthQueuingStrategy.js
new file mode 100644 (file)
index 0000000..a826736
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2015 Canon Inc.
+ * Copyright (C) 2015 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. ``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.
+ */
+
+function size(chunk)
+{
+    "use strict";
+
+    return chunk.byteLength;
+}
+
+function initializeByteLengthQueuingStrategy(parameters)
+{
+    "use strict";
+
+    Object.defineProperty(this, "highWaterMark", {
+        value: parameters.highWaterMark,
+        configurable: true,
+        enumerable: true,
+        writable: true
+    });
+}
index 9bba73c..affdc98 100644 (file)
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
+    <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSByteLengthQueuingStrategy.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSCanvasGradient.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSBeforeLoadEvent.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSBeforeUnloadEvent.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSBlob.h" />
+    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSByteLengthQueuingStrategy.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSCanvasGradient.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSCanvasPattern.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSCanvasRenderingContext.h" />
index 626f55b..3207e98 100644 (file)
     <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSBlob.cpp">
       <Filter>DerivedSources</Filter>
     </ClCompile>
+    <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSByteLengthQueuingStrategy.cpp">
+      <Filter>DerivedSources</Filter>
+    </ClCompile>
     <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSCanvasGradient.cpp">
       <Filter>DerivedSources</Filter>
     </ClCompile>
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSBlob.h">
       <Filter>DerivedSources</Filter>
     </ClInclude>
+    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSByteLengthQueuingStrategy.h">
+      <Filter>DerivedSources</Filter>
+    </ClInclude>
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSCanvasGradient.h">
       <Filter>DerivedSources</Filter>
     </ClInclude>
index 05b6dac..7d813e0 100644 (file)
                14D824080AF93AEB0004F057 /* ChromeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D824060AF93AEB0004F057 /* ChromeClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                14DC0D3709FED073007B0235 /* JSNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DC0D3509FED073007B0235 /* JSNode.cpp */; };
                14DC0D3809FED073007B0235 /* JSNode.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 14DC0D3609FED073007B0235 /* JSNode.h */; settings = {ATTRIBUTES = (); }; };
+               14DCF3B21B6BE2080062D4C3 /* JSByteLengthQueuingStrategy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DCF3B01B6BE2080062D4C3 /* JSByteLengthQueuingStrategy.cpp */; };
+               14DCF3B31B6BE2080062D4C3 /* JSByteLengthQueuingStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 14DCF3B11B6BE2080062D4C3 /* JSByteLengthQueuingStrategy.h */; };
                14DCF3B21B6BE2080062D4C2 /* JSCountQueuingStrategy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DCF3B01B6BE2080062D4C2 /* JSCountQueuingStrategy.cpp */; };
                14DCF3B31B6BE2080062D4C2 /* JSCountQueuingStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 14DCF3B11B6BE2080062D4C2 /* JSCountQueuingStrategy.h */; };
                14E8378409F85D1C00B85AE4 /* JSEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E8378309F85D1C00B85AE4 /* JSEvent.cpp */; };
                14813BF309EDF88E00F757E1 /* IDLParser.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = IDLParser.pm; path = scripts/IDLParser.pm; sourceTree = "<group>"; };
                148AFDA30AF58360008CC700 /* ExceptionHandlers.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ExceptionHandlers.h; sourceTree = "<group>"; };
                148AFDA40AF58360008CC700 /* ExceptionHandlers.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ExceptionHandlers.mm; sourceTree = "<group>"; };
+               148B4FFF1B6904C500C954E5 /* ByteLengthQueuingStrategy.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ByteLengthQueuingStrategy.idl; sourceTree = "<group>"; };
                148B4FFF1B6904C500C954E4 /* CountQueuingStrategy.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CountQueuingStrategy.idl; sourceTree = "<group>"; };
                14947FFB12F80CD200A0F631 /* DocumentOrderedMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentOrderedMap.cpp; sourceTree = "<group>"; };
                14947FFC12F80CD200A0F631 /* DocumentOrderedMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentOrderedMap.h; sourceTree = "<group>"; };
                14DC0D0B09FECFA4007B0235 /* Node.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Node.idl; sourceTree = "<group>"; };
                14DC0D3509FED073007B0235 /* JSNode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNode.cpp; sourceTree = "<group>"; };
                14DC0D3609FED073007B0235 /* JSNode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNode.h; sourceTree = "<group>"; };
+               14DCF3B01B6BE2080062D4C3 /* JSByteLengthQueuingStrategy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSByteLengthQueuingStrategy.cpp; sourceTree = "<group>"; };
+               14DCF3B11B6BE2080062D4C3 /* JSByteLengthQueuingStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSByteLengthQueuingStrategy.h; sourceTree = "<group>"; };
                14DCF3B01B6BE2080062D4C2 /* JSCountQueuingStrategy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCountQueuingStrategy.cpp; sourceTree = "<group>"; };
                14DCF3B11B6BE2080062D4C2 /* JSCountQueuingStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCountQueuingStrategy.h; sourceTree = "<group>"; };
                14E836D209F8512000B85AE4 /* Event.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Event.idl; sourceTree = "<group>"; };
                41A023EA1A39DB7900F722CF /* streams */ = {
                        isa = PBXGroup;
                        children = (
+                               148B4FFF1B6904C500C954E5 /* ByteLengthQueuingStrategy.idl */,
                                148B4FFF1B6904C500C954E4 /* CountQueuingStrategy.idl */,
                                41A023EB1A39DB7900F722CF /* ReadableStream.cpp */,
                                41A023EC1A39DB7900F722CF /* ReadableStream.h */,
                                1AC900C21943C0A0008625B5 /* HTTPHeaderNames.h */,
                                53E29E5C167A8A1900586D3D /* InternalSettingsGenerated.cpp */,
                                53E29E5D167A8A1900586D3D /* InternalSettingsGenerated.h */,
+                               14DCF3B01B6BE2080062D4C3 /* JSByteLengthQueuingStrategy.cpp */,
+                               14DCF3B11B6BE2080062D4C3 /* JSByteLengthQueuingStrategy.h */,
                                14DCF3B01B6BE2080062D4C2 /* JSCountQueuingStrategy.cpp */,
                                14DCF3B11B6BE2080062D4C2 /* JSCountQueuingStrategy.h */,
                                409EBDC416B7F3CA00CBA3FC /* JSCSSFontFaceLoadEvent.cpp */,
                                6FA4454E898F2FC168BC38C1 /* JSBeforeUnloadEvent.h in Headers */,
                                FDF09DC91399B62200688E5B /* JSBiquadFilterNode.h in Headers */,
                                2E2D99CE10E2BBDA00496337 /* JSBlob.h in Headers */,
+                               14DCF3B31B6BE2080062D4C3 /* JSByteLengthQueuingStrategy.h in Headers */,
                                1449E24C107D4A8400B5793F /* JSCallbackData.h in Headers */,
                                65DF323A09D1DE65000BE325 /* JSCanvasGradient.h in Headers */,
                                65DF323C09D1DE65000BE325 /* JSCanvasPattern.h in Headers */,
                                FD8AA63C1695148E00D2EA68 /* JSBiquadFilterNodeCustom.cpp in Sources */,
                                2E2D99CD10E2BBDA00496337 /* JSBlob.cpp in Sources */,
                                8931DE5B14C44C44000DC9D2 /* JSBlobCustom.cpp in Sources */,
+                               14DCF3B21B6BE2080062D4C3 /* JSByteLengthQueuingStrategy.cpp in Sources */,
                                1449E287107D4DB400B5793F /* JSCallbackData.cpp in Sources */,
                                65DF323909D1DE65000BE325 /* JSCanvasGradient.cpp in Sources */,
                                65DF323B09D1DE65000BE325 /* JSCanvasPattern.cpp in Sources */,
index 67f30e3..9c388bb 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 
 #if ENABLE(STREAMS_API)
+#include "ByteLengthQueuingStrategyBuiltins.cpp"
 #include "CountQueuingStrategyBuiltins.cpp"
 #include "ReadableStreamBuiltins.cpp"
 #endif
index 086d7ea..0b75f1d 100644 (file)
@@ -28,6 +28,7 @@
 #include <wtf/RefPtr.h>
 
 #if ENABLE(STREAMS_API)
+#include "ByteLengthQueuingStrategyBuiltinsWrapper.h"
 #include "CountQueuingStrategyBuiltinsWrapper.h"
 #include "ReadableStreamBuiltinsWrapper.h"
 #endif
@@ -43,6 +44,7 @@ public:
 #if ENABLE(STREAMS_API)
     explicit WebCoreJSClientData(JSC::VM& vm)
         : m_readableStreamBuiltins(&vm)
+        , m_byteLengthQueuingStrategyBuiltins(&vm)
         , m_countQueuingStrategyBuiltins(&vm)
 #else
     WebCoreJSClientData(JSC::VM&)
@@ -84,6 +86,7 @@ public:
 
 #if ENABLE(STREAMS_API)
     ReadableStreamBuiltinsWrapper& readableStreamBuiltins() { return m_readableStreamBuiltins; }
+    ByteLengthQueuingStrategyBuiltinsWrapper& byteLengthQueuingStrategyBuiltins() { return m_byteLengthQueuingStrategyBuiltins; }
     CountQueuingStrategyBuiltinsWrapper& countQueuingStrategyBuiltins() { return m_countQueuingStrategyBuiltins; }
 #endif
 
@@ -93,6 +96,7 @@ private:
 
 #if ENABLE(STREAMS_API)
     ReadableStreamBuiltinsWrapper m_readableStreamBuiltins;
+    ByteLengthQueuingStrategyBuiltinsWrapper m_byteLengthQueuingStrategyBuiltins;
     CountQueuingStrategyBuiltinsWrapper m_countQueuingStrategyBuiltins;
 #endif
 };