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
This changes the network API to use BufferSource instead of ArrayBuffer,
which allows plugins to return a "view" on a buffer instead of the
whole buffer. This also adds some utilities for changing between
views and buffers.
Lastly this forbids the use of the "buffer" property of TypedArrays
since it doesn't work with partial "views". This audits and fixes the
usages of the "buffer" property to ensure correct usage.
It should be noted that both MSE and EME accept a BufferSource as input,
so we don't need to convert a "view" into an ArrayBuffer before passing
to it.
Change-Id: Iaa417773f8ce5304424e43c7372ce10ebf540d2a
This is a helper to aid in iterating over items. This returns a list
of objects that contain:
- "item": The current value.
- "prev": The previous value in the list.
- "next": The next value in the list.
- "i": The zero-based index in the list.
Issue #1518
Change-Id: Id18ab977e3ae45dfbfd2b4137a1bffb6e53c6bce
Instead of using an array of Uint8Arrays, which could trigger a
load-time failure on very old browsers, store an array of number
arrays. This is equivalent for the purpose of comparison, and it
cannot fail at load-time.
This cleanup seems to fix minor test flake in the EBML parser tests
that was observed with upgraded node modules.
Issue #1694
Change-Id: I87b2307bceddb3a21dfc81d4fe9828afd9508617
This is a fully automated change. The linter will fail because the
extra indentation caused line-length errors. These won't be fixed
automatically. They are fixed in a follow-up to make this one fully
automated.
Change-Id: I4d8cf9c998985add2bcd24a81c8d65495668c4f3
With the new style rule, we cannot have two statements on the same line.
So we can no longer have an "if" on a single line and we cannot have
an arrow function with a body on the same line as when it is used.
This is mostly a manual change.
Change-Id: I2285202dd5ecbad764308bc725e6d317ff2ee7f0
This reorders the rules so they mostly are ordered the same as the
eslint documentation. The exception is the few at the top, most of
which should be removed. This also removes some rules that appear in
the recommended or the Google set. Lastly this adds some more rules:
- Require parenthesis when using "new".
- Disallow confusing regex (e.g. /=/).
- Disallow some confusing coercions (e.g. +foo).
- Disallow some Unicode characters in a regex.
- Disallow using "async" in a Promise constructor.
Change-Id: I597b472bdaee5b4cb92354f057e7ae6aeb96eefa
A follow-up commit will convert "function" functions to arrow functions.
This caused some errors with the compiler, which this change fixes
beforehand.
Change-Id: Iff85b1e1f56b63a38b09f8db9947ed5daf02ddf4
A coming update to the Google eslint config will require using "const"
over "let". This makes that one change to isolate the big changes.
Change-Id: I7d0974c3ae15c53cc45a6b07bf9f6586e2d34aca
This makes it easy to dump and restore databases from IndexedDB. This,
in turn, makes it easy for us to test that all database versions can
be read. Before we close the backward compatibility issue that has
plagued v2.3, we will add tests that use this utility to load DB
snapshots from various older schemas and prove that they can still be
read.
This also adds dumps of all database versions to the assets folder,
including a snapshot of a what our broken upgrade in v2.3.0 did to the
v2 database schema.
Issue #1248
Change-Id: If7e8995f50abbdee67e3fa93e79f07a49582c5e8
This is part of a change to convert all usages of 'var' with either
'let' or 'const'. This takes a conservative approach for 'const' where
it will only be used for aliases and storing the "original" values in
tests.
Change-Id: I10f5c38a8b06b5797c6eec7492829084114514c9
By exporting StringUtils and Uint8ArrayUtils, we can simplify the
process of wrapping, unwrapping, and parsing requests and responses
in NetworkingEngine filters.
This makes it easier to write filters that deal with text-based
data, as it is no longer the job of the application developer to
deal with subtle conversions between string and ArrayBuffer.
We will also fill in requests with defaults if needed. This allows
developers to omit fields when initiating extra requests at the
application level.
Closes#667
Change-Id: Ie6a0f23b4d46e7e458d996759eac6cd85a36b741
Before there were two style to indent comments after an annotation,
using 2 and 4 spaces. Now this only uses 2 spaces.
Change-Id: Id06415d7193cc154a2768fb3932aff7a06b7ed32
Before, we simply converted each byte from an ArrayBuffer into a
character; however, this is only valid for ASCII characters. This
changes it to fully support UTF-8 encoded network responses.
Change-Id: I9c49f29b09960501d345b98aa7af1bb711972abf
This changes namespace exports to the more targetted exportDoc,
adds exports where they are needed and removes them where they are
not. Exporting of Uint8Array and String utils should be re-evaluated
later.
Change-Id: I9298e73a0a5ef026b6f2b1854488d2c359be10c1
These keys cannot always be used as keys, for example on IE11 where
very large init datas are found in PlayReady content. Since there
should not be a large number of unique init datas, a linear
suppression pass and a quadratic removeDuplicates should not be a
problem in practice.
Related to pull #176
Change-Id: I9dd9b5e45422544c86dd95686766625a0b336963
* Updates all Copyright years to 2015.
* Adds licenses annotations to all JS.
* Makes all licenses identical to avoid repeated appearance in the
compiled output.
* Drops fileoverview annotations, which do not affect docs output.
* The linter still requires fileoverview on externs.
This patch required a newer closure compiler, since the previous
version we used had a bug regarding license annotations that caused
the license comment block to appear in the output once per file
regardless of uniqueness.
Change-Id: I2e9272db680cba7ecc4613d97f1d3a94ac2244cc
This reverts commit 8cb24652cb, due to
the fact that the new annotations caused our binary size to jump
by 52%.
The compiler preserves all 'unique' licenses, which causes trouble
since the comment blocks with the license annotations are not unique
and contain file overview comments as well.
We can re-examine this once we have restructured the license headers.
Change-Id: I418e407a0e0253630633697f30cf496a7fc2ddfc
Most of these StringUtils were either operating on Uint8Arrays directly
or using strings to move around Uint8Array data anyhow.
Change-Id: I71efe6ede34210ca721d46acd53452344efff5bb