Index: Source/core/streams/CountQueuingStrategy.js |
diff --git a/Source/core/streams/CountQueuingStrategy.js b/Source/core/streams/CountQueuingStrategy.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a0154a20187170f336555ed938a1bfd7aaa74642 |
--- /dev/null |
+++ b/Source/core/streams/CountQueuingStrategy.js |
@@ -0,0 +1,29 @@ |
+(function(global, exports) { |
+ 'use strict'; |
+ |
+ const NONE = 0; |
+ const DONT_ENUM = 2; |
+ |
+ class CountQueuingStrategy { |
+ constructor(options) { |
+ %AddNamedProperty(this, 'highWaterMark', options.highWaterMark, NONE); |
+ } |
+ |
+ size(chunk) { |
+ return 1; |
+ } |
+ } |
+ |
+ %AddNamedProperty(global, 'CountQueuingStrategy', CountQueuingStrategy, DONT_ENUM); |
+ |
+ // Export a separate copy that doesn't need options objects and can't be interfered with. |
+ exports.BuiltInCountQueuingStrategy = class BuiltInCountQueuingStrategy { |
+ constructor(highWaterMark) { |
+ %AddNamedProperty(this, 'highWaterMark', highWaterMark, NONE); |
+ } |
+ |
+ size(chunk) { |
+ return 1; |
+ } |
+ }; |
+}); |