Add use counters for streams
Add use counters to the constructors for ReadableStream, WritableStream and TransformStream. A new function, binding.countUse(), is added to the V8 Extras binding object and called from the constructors. See the V8 Extras Design Doc for more details on how this works: https://docs.google.com/document/d/1AT5-T0aHGp7Lt29vPWFr2-qG8r3l9CByyvKwEuA8Ec0/edit#heading=h.334ekprhracb binding.countUse() is registered by a new C++ function, AddUseCounterFunctionToV8ExtrasBindings() which is called when setting up the Javascript contexts for windows and workers. To help implement tests for the new function, some test functions have been factored out of core/streams/ReadableStreamOperationsTest.cpp into V8ExtrasTestUtils.{h,cpp}. There are also new layout tests to verify that the use counters are correctly set. Internal creation of a ReadableStream by creating a Response object does not set the counter. Currently constructing a TransformStream also set the ReadableStream constructor use counter. This will be fixed once ReadableStream has been updated to the latest standard version (http://crbug.com/710728). Bug: 769663 Change-Id: I484ef6843cbb800b345d56cf67d09e45b97ab3a3 Reviewed-on: https://chromium-review.googlesource.com/985345Reviewed-by:Kent Tamura <tkent@chromium.org> Reviewed-by:
Yutaka Hirano <yhirano@chromium.org> Reviewed-by:
Yuki Shiino <yukishiino@chromium.org> Commit-Queue: Adam Rice <ricea@chromium.org> Cr-Commit-Position: refs/heads/master@{#547420}
Showing
Please register or sign in to comment