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

Unified Diff: Source/core/streams/CountQueuingStrategy.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/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;
+ }
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698