Handle buffer boundaries in the WebVTT parser

Replace the somewhat ad-hoc collectNextLine method with a new helper
class - BufferedLineReader - that takes care of buffering the input
data across buffer boundaries.

While redoing the line collection, also fix the handling of NULs in the
input stream to match the spec (transform to U+FFFD).

TEST=unittest:BufferedLineReader.*
TEST=http/tests/media/track/track-webvtt-slow-loading-2.html
BUG=231460

Review URL: https://codereview.chromium.org/64303004

git-svn-id: svn://svn.chromium.org/blink/trunk@161624 bbb929c8-8fbe-4397-9dbb-9b2b20218538
8 files changed
tree: c5c1097ac0234d0edc90b9d678c54ec21d6b1cc8
  1. third_party/