Chromium Code Reviews
DescriptionUse StringView for String::append and ::insert.
This avoids allocating temporary strings when calling this method with a literal
string. I also simplified the code by merging the code paths.
Since StringAppend can't implicitly convert to StringView we can no longer write:
string.append(stringA + stringB) or string.append(stringA + "foo") since the
result of the + operator (a StringAppend object) is not allowed anymore. Doing
this actually caught a bunch of callers which were allocating temporary strings
trying to build up a bigger string and should be using StringBuilder instead. For
example extractWebGLContextCreationError was allocating a huge number of
temporary strings.
BUG=615174
Committed: https://crrev.com/f10ca9328c07c6bddfe281336072d5650a533dfc
Cr-Commit-Position: refs/heads/master@{#411285}
Patch Set 1 #Patch Set 2 : Fix appendHex stuff. #Messages
Total messages: 22 (16 generated)
|