Turn VTTToken into an immutable object

With the data-handling in VTTTokenizer::nextToken simplified to use
fewer entrypoints on VTTToken, it becomes easier to simply remove
intermediate buffers/StringBuilders from the token type, and instead
store them on the stack of nextToken().

Remove appendToData() from VTTToken, and replace it with append()s
on a local StringBuilder instead. Treat addNew{Class,Annotation}
similarly. The "new" StringBuilders are named as the corresponding
"strings" in the spec text.

This means that VTTToken can be turned into a "data blob" that is
created by the tokenizer and passed back to the caller.

BUG=319391

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

git-svn-id: svn://svn.chromium.org/blink/trunk@162548 bbb929c8-8fbe-4397-9dbb-9b2b20218538
4 files changed