Commit Graph

12 Commits

Author SHA1 Message Date
Wojciech Tyczyński 55b7bd0a70 fix: Forbid usage of instanceof ArrayBuffer (#7653)
Fixes #6279
2024-11-26 11:16:00 +01:00
Wojciech Tyczyński 155befb0a0 fix: ban new Uint16Array(buffer) (#5838)
Due to typo, banned call has been executed.
Fixes typo and adds support to `Uint16Array` in `BufferUtils`.
2023-10-31 14:41:25 +01:00
Rahul Kamat b36194878e fix: add strictMissingProperties suppressions to unblock strict missing properties on union types. (#4371)
JSCompiler's strict missing properties on union types change improves the missing properties check to report properties that do not exist on all members of union types (excluding null or undefined and after boxing primitives).
2022-07-22 15:07:20 -07:00
Álvaro Velad Galván 57c73241a0 fix(performance): Eliminate use of ES6 generators (#4092)
See: https://github.com/shaka-project/shaka-player/issues/4062#issuecomment-1077826210

Co-authored-by: @joeyparrish

Issue #4062
2022-04-04 10:58:16 -07:00
Joey Parrish f539147d48 fix: Correct license headers in compiled output
This fixes all the license headers in the main library, which corrects
the appearance of the main license in the compiled output.

It seems that the `!` in the header forces the compiler to keep it in
the output.  I believe older compiler releases did this purely based
on `@license`.

Issue #2638

Change-Id: I7f0e918caad10c9af689c9d07672b7fe9be7b2f3
2020-06-09 16:05:09 -07:00
Álvaro Velad Galván a201be414a fix: export shaka.util.FairPlayUtils and shaka.util.BufferUtils (#2628)
@exportInterface is used by the extern generator, but ignored by the
compiler. @export should be used for shaka.util.FairPlayUtils and
shaka.util.BufferUtils.

Closes #2626 and #2627
2020-06-09 07:32:59 -07:00
Joey Parrish 64896d70b0 Use shorter license header
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.

This also updates the company name from "Google, Inc" to "Google LLC".

Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
2019-11-22 18:18:36 +00:00
Jacob Trimble ea84dfe494 Avoid creating buffers in PSSH.
Now shaka.util.Pssh will only create a view on the buffer instead of
re-creating the PSSH boxes for each element.  This also removes the
boundaries field since the data fields are the useful ones.

This also fixes a possible bug in BufferUtils, updates comments, and
adds some more tests for negative offsets.

Change-Id: Ibe1b7d61d5f5c7e52dfd7aa954db98f0592da4a5
2019-11-05 23:32:37 +00:00
Jacob Trimble b9bad77f70 Mark unsafeGetArrayBuffer as private.
This is no longer used anywhere else.

Change-Id: I7ec005d5d65b195a591ab95fa32bba3518ff3083
2019-08-21 22:02:33 +00:00
Jacob Trimble 18b59c5294 Disallow using new Uint8Array with BufferSource.
Using "new Uint8Array" with a TypedArray creates a copy of the buffer;
this is unnecessarily expensive for large buffers.  This adds a rule
to disallow using it in favor of a new utility that correctly creates
a new "view" on the same buffer.

Note it is fine to pass an ArrayBuffer to "new Uint8Array" and it won't
copy; but there there are many cases where the type is BufferSource,
so it could be a TypedArray.  Unfortunately, there are many other cases
where we explicitly pass an ArrayBuffer; but the compiler rules don't
allow us to whitelist this case (since ArrayBuffer is part of
BufferSource).

Change-Id: I58696a85a9cbcc188c0b16919c9eeb63e56edca1
2019-08-21 20:40:59 +00:00
Jacob Trimble ac4fdfd0cd Make the reader types more permissive of inputs.
Now the EbmlParser and DataViewReader types can accept BufferSource
objects to avoid the caller having to convert it at each callsite.

Change-Id: I527fbc638485214bfe976d7da89b79b6098033a8
2019-08-20 22:08:27 +00:00
Jacob Trimble a2bcf7278d Move some utilities to BufferUtils.
Change-Id: Ifb3c4348cc912640b99ff53f7cac59a63480c68e
2019-08-20 22:07:35 +00:00