Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1611)

Unified Diff: Source/core/streams/ByteLengthQueuingStrategy.js

Issue 1167343002: Add methods for creating V8 extras-based ReadableStreams from C++ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove C++ queuing strategies Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/streams/ByteLengthQueuingStrategy.js
diff --git a/Source/core/streams/ByteLengthQueuingStrategy.js b/Source/core/streams/ByteLengthQueuingStrategy.js
new file mode 100644
index 0000000000000000000000000000000000000000..6b54d953f0dd415e48ffd8e89f131d809ba2dc2d
--- /dev/null
+++ b/Source/core/streams/ByteLengthQueuingStrategy.js
@@ -0,0 +1,18 @@
+(function(global) {
+ 'use strict';
+
+ const NONE = 0;
+ const DONT_ENUM = 2;
+
+ class ByteLengthQueuingStrategy {
+ constructor(options) {
+ %AddNamedProperty(this, 'highWaterMark', options.highWaterMark, NONE);
+ }
+
+ size(chunk) {
+ return chunk.byteLength;
+ }
+ }
+
+ %AddNamedProperty(global, 'ByteLengthQueuingStrategy', ByteLengthQueuingStrategy, DONT_ENUM);
+});

Powered by Google App Engine
This is Rietveld 408576698