Implement TextEncoder()'s encodeInto method

This CL implements the encodeInto method on the TextEncoder interface,
which encodes a string into a given pre-allocated Uint8Array. This CL
introduces an EncodeInto() method to TextCodecUTF8, which acts similar to
EncodeCommon(), however is bound by a given capacity, and also outputs
the number of converted UTF16 code units. EncodeInto() is called via an
overloaded TextCodec::Encode() method, which is meant only to be implemented
in TextCodecUTF8 (since that is only where EncodeInto() is used).

Intent to Implement and Ship:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/vTNMrsScW1g

R=jsbell@chromium.org, kinuko@chromium.org, ricea@chromium.org

Bug: 920107
Change-Id: I178f927e837833731049c4867c0eb71e90d369cc
Reviewed-on: https://chromium-review.googlesource.com/c/1456637
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Dominic Farolino <domfarolino@gmail.com>
Cr-Commit-Position: refs/heads/master@{#631002}
24 files changed