Implement fast path in UTF8ToUTF16 for pure ASCII strings

Blink WebString::fromUTF8 are marginally faster than UTF8ToUTF16 on
pure ASCII input because they have a fast path for this case. Implement
the same thing for base::UTF8ToUTF16

DoIsStringASCII is now a port of charactersAreAllASCII from Blink.

BUG=391492
R=brettw@chromium.org, torne@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#297158}


CrOS-Libchrome-Original-Commit: 6f500092b9396517a40fdf1ca6a5199738e673e9
4 files changed
tree: f02659e1206e68425a1cb4c4bcf8ba45d268d6ac
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/