Add new helper VTTParser::collectDigitsToInt

Since most uses of VTTParser::collectDigits is followed by a call to
String::toInt on the resulting string, add this new helper with the
aim of later removing the temporary string construction.
Handle overflow in the string-to-int conversion by means of saturation.
(The latter is the intended change of semantics.)

Replace uses of collectDigits with collectDigitsToInt where applicable.
After doing this, there remain no callers to collectDigits outside of
VTTParser, so make the function static.

Also move VTTParser::skipWhiteSpace "textually" to group it with the other
'scanning' functions, and make it static since it does not depend on any
VTTParser state.

BUG=305317

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

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