This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25966 - Use ArrayBufferView and ArrayBuffer instead of Uint8Array in APIs
Summary: Use ArrayBufferView and ArrayBuffer instead of Uint8Array in APIs
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Encrypted Media Extensions (show other bugs)
Version: unspecified
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: David Dorwin
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on: 23369
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-03 21:27 UTC by David Dorwin
Modified: 2014-10-20 18:30 UTC (History)
7 users (show)

See Also:


Attachments

Description David Dorwin 2014-06-03 21:27:28 UTC
The EME APIs currently use Uint8Array for all binary data. Uint8Array is just a subclass of ArrayBufferView, and I don't think there is a reason to require 8-bit formatting.

For data provided to the application, we might need to use an ArrayBuffer.

MSE's appendBuffer() accepts either ArrayBuffer or ArrayBufferView [1]. I'm not sure whether EME needs to support both.

[1] https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source-respec.html#widl-SourceBuffer-appendBuffer-void-ArrayBuffer-data
Comment 1 Jerry Smith 2014-06-13 00:30:05 UTC
I don't see any reason now not to switch to ArrayBuffer, but am confirming with some others.

ArrayBufferView adds the ability to view data with an offset.  For SourceBuffer, that seems useful.  It's harder to see where it would be of use in EME.
Comment 2 David Dorwin 2014-06-17 15:18:21 UTC
Notes from telecon today:

Anne pointed us to WebIDL bug 23369.

Adrian proposed that EME methods should accept either. That allows a view of a buffer to be passed as well as an ArrayBuffer to be passed without creating a view.

Event attributes should be an ArrayBuffer.
Comment 4 David Dorwin 2014-10-06 17:56:38 UTC
Bug 23369 has been resolved by, among other things, adding:
  typedef (ArrayBufferData or ArrayBuffer) BufferSource;

I'm reopening this to track updating the spec to use the typedef for method parameters.

http://heycam.github.io/webidl/#common-BufferSource
http://heycam.github.io/webidl/#idl-buffer-source-types
Comment 5 David Dorwin 2014-10-20 18:22:03 UTC
(In reply to David Dorwin from comment #4)
> Bug 23369 has been resolved by, among other things, adding:
>   typedef (ArrayBufferData or ArrayBuffer) BufferSource;

This work had been blocked by a typo in this text (bug 27110). This is now fixed:
  typedef (ArrayBufferView or ArrayBuffer) BufferSource;
Comment 6 David Dorwin 2014-10-20 18:30:14 UTC
https://dvcs.w3.org/hg/html-media/rev/54693f404322 uses the new BufferSource typedef.