Add helpers for byte[] <-> std::string.

Several places in the code convert between Java byte arrays and C++
std::string, and some had implemented a local helper function for this.
Add a generic helper for this to base instead, and convert existing
places that do this to use the helper.

Test: base_unittests
Change-Id: Ia56fb6333bd6c453207814b0bcb5ac58b5488c20
Reviewed-on: https://chromium-review.googlesource.com/1255342
Commit-Queue: Richard Coles <[email protected]>
Reviewed-by: Pavel Yatsuk <[email protected]>
Reviewed-by: John Rummell <[email protected]>
Reviewed-by: Jochen Eisinger <[email protected]>
Cr-Commit-Position: refs/heads/master@{#595863}
12 files changed