DescriptionRemove ComponentLoader's unnecessary string copy.
ComponentLoader::Add(int manifest_id, ...) is how most components extensions
get added. Couple of exceptions are: pdf_extension and IME. Otherwise,
ComponentLoader::Add gets the resource from ResourceBundle and then converts the
StringPiece representing the resource to std::string (copy) and feeds them to
ComponentLoader::ParseManifest().
ParseManifest construct a StringPiece from the std::string since
JSONStringValueDeserializer is capable of working with StringPiece-s.
This CL removes the intermediate conversion from StringPiece to string for
most of the cases.
This probably helps chormeos more than non-chromeos, since I saw 30 component
extension being loaded through ComponentLoader resulting in 49254 bytes
of unnecessary copy.
BUG=638775
Test=No observable change. FYI: this can affect built in chromeos extensions.
Committed: https://crrev.com/3cdbf74891491f09473f87ebf215d327ff27296d
Cr-Commit-Position: refs/heads/master@{#412719}
Patch Set 1 #
Messages
Total messages: 12 (7 generated)
|