Commit Graph

10 Commits

Author SHA1 Message Date
Jacob Trimble adb8da4764 Disallow unknown properties (1/5).
This is part of adding a new conformance rule to add additional type
safety.  This will disallow using properties of unknown types or using
unknown properties.

The first parts will be fixing errors caused by the new rule.  These
are backwards compatible, so can be applied before the rule is enabled.
Once all the errors and bugs are fixed, the rule will be enabled.

Change-Id: Iefde089b2f62ddfdf43944cda5badab438577561
2017-06-27 19:43:00 +00:00
Joey Parrish 1eb5a41d6f Fix failed assertion tearing down offline tests
Discovered while working on #894

Change-Id: Icf74cd4bf804df0b055033f9c1113971e1644202
2017-06-22 20:14:21 +00:00
Aaron Vaage 730fd9e44f Replacing Cursor Delete In DBEngine
After looking into the speeds for removing data from IndexedDB, it was
found that using a cursor was slower than the other methods. This change
takes the remove logic and changes it to remove each key as part of
one transaction.

Closes #756

Change-Id: Iec3916650d8a4fe2b6353b604c070d8a0af7426c
2017-05-11 21:42:53 +00:00
Aaron Vaage 0698987836 Fix Offline Download Stalls on Android
On android the quota for offline content is much smaller than on
desktop. It was observed that when this quote was exceeded that
downloading offline content would stall but not throw and error.
It was found that instead of an error, IndexDB called onabort for
the transaction.

To fix this we now route onabort through the same code path as
onerror so that the abort will be treated and communicated as an
error back to the application.

Closes #747

Change-Id: I10d536a4edc29d51790f0588f6163a5d83eccf33
2017-05-04 18:02:18 +00:00
Jacob Trimble 575f2ad109 Add an indicator for critical errors.
This adds a severity field to Error objects.  This can be used to
detect whether an error is recoverable.  All the same errors are still
reported so the field can be ignored.

There are two possible values:
* RECOVERABLE means that the Player will try to recover from the error
* CRITICAL means the Player will be unable to continue and must call
  load() again

Closes #564

Change-Id: Ie2c5468340c13e7a288b99690ab65b7ecc0a6b29
2017-04-04 23:57:59 +00:00
Jacob Trimble 7dbc6c4b12 Workaround IndexedDB race on IE/Edge.
This implements the workaround for a race in IndexedDB on IE/Edge.
If we don't get an 'upgradeneeded' event when we expect it, we will
close the connection and retry.

b/35993864

Change-Id: I78d1c18e4798c098167a1a6a184623780002a34f
2017-03-20 21:32:32 +00:00
Jacob Trimble 7b729a0778 Add assertions for IndexedDB race on IE/Edge.
On IE/Edge, it is possible for the IndexedDB database to not be deleted
when the success callback is fired.  If we immediately create a new
connection to that database, it will connect to the old database.  Once
the database is deleted, the connection will no longer have the data.

This adds some assertions that we get an upgrade event.  This also adds
the framework for the workaround, but doesn't add it so we can give
this revision in the bug report.  This deliberately increases the
failure rates on IE/Edge.

b/35993864

Change-Id: I3d142bdee6386fbe63f1b2def462a0e039723a38
2017-03-17 19:03:31 +00:00
Aaron Vaage 3db0f3357a Creating IStorageEngine Interface
To better support alternate storage mechanisms, this change abstracts
shaka.offline.DBEngine into an interface called
shaka.offline.IStorageEngine.

DBEngine has been changed to implement this interface, and allows the
addition of implementations that do not use IndexedDB.

Change-Id: I6a94067001ee53049df11cb68604bb57912300bb
2017-02-10 21:27:32 +00:00
Andy Hochhaus 87a62d717e Add missing goog.require() dependencies 2016-06-25 15:45:15 -07:00
Jacob Trimble c7c2b41ac9 Add DBEngine to manage IndexedDB connections.
This is part of the v2 equivalent of the ContentDatabase.  This only
manages low-level interactions with the IndexedDB and wraps all
actions in Promises.

This also adds an in-memory version that is used for testing.

Issue #343

Change-Id: I0d296639e74c1d4cab232ce7248b03a353b38b3c
2016-05-20 11:22:50 -07:00