summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/streams/ByteLengthQueuingStrategy.js
blob: f0a2771cd90493cddc3ac57261ff0a8d7e639776 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// eslint-disable-next-line no-unused-vars
(function(global, binding, v8) {
  'use strict';

  const defineProperty = global.Object.defineProperty;

  class ByteLengthQueuingStrategy {
    constructor(options) {
      defineProperty(this, 'highWaterMark', {
        value: options.highWaterMark,
        enumerable: true,
        configurable: true,
        writable: true
      });
    }
    size(chunk) {
      return chunk.byteLength;
    }
  }

  defineProperty(global, 'ByteLengthQueuingStrategy', {
    value: ByteLengthQueuingStrategy,
    enumerable: false,
    configurable: true,
    writable: true
  });
});