Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement QueuingStrategies in C++ #17804

Merged
merged 1 commit into from Jul 23, 2019

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jul 12, 2019

Implement CountQueuingStrategy and ByteLengthQueuingStrategy in C++.

Implementing in WebIDL leads to some changes in semantics:

  1. highWaterMark is now a getter on the prototype rather than an
    property on each object. This is because adding properties directly on
    objects is not usual practice in WebIDL, and is problematic to implement
    in Blink.

  2. size() is now a function returned by a getter. This is because a
    methods in WebIDL must be called with |this| set to a valid object of
    the appropriate type, but size() is called with |this| set to undefined.
    See Specifying QueuingStrategies in WebIDL whatwg/streams#1005 for more discussion.

These aren't expected to change behaviour of code in the wild, but the
count-queuing-strategy.any.js and byte-length-queuing-strategy.js
tests detect it.

Also add tests that subclassing of CountQueuingStrategy and
ByteLengthQueuingStrategyworks works properly. A previous iteration
of this change broke it.

Bug: 981333
Change-Id: Ifc18a469a58f73d54563ca549a1c8db0e001303b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1692108
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#679897}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already reviewed downstream.

Implement CountQueuingStrategy and ByteLengthQueuingStrategy in C++.

Implementing in WebIDL leads to some changes in semantics:

1. highWaterMark is now a getter on the prototype rather than an
property on each object. This is because adding properties directly on
objects is not usual practice in WebIDL, and is problematic to implement
in Blink.

2. size() is now a function returned by a getter. This is because a
methods in WebIDL must be called with |this| set to a valid object of
the appropriate type, but size() is called with |this| set to undefined.
See whatwg/streams#1005 for more discussion.

These aren't expected to change behaviour of code in the wild, but the
count-queuing-strategy.any.js and byte-length-queuing-strategy.js
tests detect it.

Also add tests that subclassing of CountQueuingStrategy and
ByteLengthQueuingStrategyworks works properly. A previous iteration
of this change broke it.

Bug: 981333
Change-Id: Ifc18a469a58f73d54563ca549a1c8db0e001303b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1692108
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#679897}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants