Uptake http://trac.webkit.org/changeset/169848

Set |length| based on |buffer|, not |content|. Switch to using a for loop.
Switch to unsigned types since we are working with positive offsets
into a String. Make sure to never cross the length boundary.

BUG=383703

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176713 bbb929c8-8fbe-4397-9dbb-9b2b20218538