JSONStringValueSerializer takes a StringPiece instead of std::string&.
This allows callers to pass a char* (string literal) or StringPiece (lightweight substring) without having to explicitly construct a string object. Refactored the implementation to avoid an ugly const_cast and Boolean to avoid mutating a const pointer. Updated tests to use char* literals, and added some new tests to test the new edge cases. BUG=455068 Review URL: https://codereview.chromium.org/895913004 Cr-Commit-Position: refs/heads/master@{#314728}
Showing
Please register or sign in to comment