DescriptionJSONStringValueSerializer 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
Committed: https://crrev.com/a82ce4efc2cfa3812b96e22b5d3a68f915c7fbfb
Cr-Commit-Position: refs/heads/master@{#314728}
Patch Set 1 #
Messages
Total messages: 10 (2 generated)
|