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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, binding, v8) { 5 (function(global, binding, v8) {
6 'use strict'; 6 'use strict';
7 7
8 const defineProperty = global.Object.defineProperty; 8 const defineProperty = global.Object.defineProperty;
9 9
10 class CountQueuingStrategy { 10 class CountQueuingStrategy {
11 constructor(options) { 11 constructor(options) {
12 defineProperty(this, 'highWaterMark', { 12 defineProperty(this, 'highWaterMark', {
13 value: options.highWaterMark, 13 value: options.highWaterMark,
14 enumerable: true, 14 enumerable: true,
15 configurable: true, 15 configurable: true,
16 writable: true 16 writable: true
17 }); 17 });
18 } 18 }
19
19 size(chunk) { return 1; } 20 size(chunk) { return 1; }
20 } 21 }
21 22
22 defineProperty(global, 'CountQueuingStrategy', { 23 defineProperty(global, 'CountQueuingStrategy', {
23 value: CountQueuingStrategy, 24 value: CountQueuingStrategy,
24 enumerable: false, 25 enumerable: false,
25 configurable: true, 26 configurable: true,
26 writable: true 27 writable: true
27 }); 28 });
29
30 // Export a separate copy that doesn't need options objects and can't be
31 // interfered with.
32 class BuiltInCountQueuingStrategy {
33 constructor(highWaterMark) {
34 defineProperty(this, 'highWaterMark', {value: highWaterMark});
35 }
36
37 size(chunk) { return 1; }
38 }
39
40 binding.createBuiltInCountQueuingStrategy = highWaterMark =>
41 new BuiltInCountQueuingStrategy(highWaterMark);
28 }); 42 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698