Remove base::string_as_array

https://crrev.com/550137 introduced base::data(), along with a
specialization for strings to return mutable pointers. Update callers
of base::string_as_array() to use base::data() instead.

Note that this does come with an observable behaviour change:
string_as_array() returns nullptr for empty strings, while base::data()
returns the pointer to the NUL terminator (in line with std::data()).

However, this can be observed to be safe from the existing callers, due
to the preceding resizes that ensure non-empty() strings, or the
existing logic to handle empty strings.

Bug: 828324
TBR=caitkp@chromium.org, lazyboy@chromium.org, miu@chromium.org, sergeyu@chromium.org

Change-Id: I1fb5824b7115ff2b9ebf032f74a860e4cf3f52c6
Reviewed-on: https://chromium-review.googlesource.com/1056014
Commit-Queue: Ryan Sleevi <rsleevi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558321}

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