[go: nahoru, domu]

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}
39 files changed