mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
We used to share memory between Dart strings and WTF::String objects by way of the Dart externalized strings. That used to be important when the DOM shared many strings between C++ and Dart. However, now that we don't retain strings in C++ much anymore, we don't need this complexity. This patch removes DartStringCache and the integration. It also unwinds several cases where we were converting back and forth between WTF::String and std::string for no reason. Now we use std::string more consistently. For the case of ParagraphBuilder::addText, we now take a raw const char*, which more closely matches the API the DartVM exposes. That means we do a single copy out of the VM and into the render tree at that point.