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

Unified Diff: third_party/WebKit/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: Trying blindly to resolve circular dependency Created 4 years, 10 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: third_party/WebKit/Source/core/streams/CountQueuingStrategy.js
diff --git a/third_party/WebKit/Source/core/streams/CountQueuingStrategy.js b/third_party/WebKit/Source/core/streams/CountQueuingStrategy.js
index 61567c899512697bcc2a8ce65b931282974f0661..36141b74d34b905f05c91f912c67cd2ffc93b22b 100644
--- a/third_party/WebKit/Source/core/streams/CountQueuingStrategy.js
+++ b/third_party/WebKit/Source/core/streams/CountQueuingStrategy.js
@@ -16,6 +16,7 @@
writable: true
});
}
+
size(chunk) { return 1; }
}
@@ -25,4 +26,17 @@
configurable: true,
writable: true
});
+
+ // Export a separate copy that doesn't need options objects and can't be
+ // interfered with.
+ class BuiltInCountQueuingStrategy {
+ constructor(highWaterMark) {
+ defineProperty(this, 'highWaterMark', {value: highWaterMark});
+ }
+
+ size(chunk) { return 1; }
+ }
+
+ binding.createBuiltInCountQueuingStrategy = highWaterMark =>
+ new BuiltInCountQueuingStrategy(highWaterMark);
});

Powered by Google App Engine
This is Rietveld 408576698