ScopedClipboardWriter & Clipboard are doing some unneeded operations:
ScopedClipboardWriter uses Clipboard::ObjectMapParam to store the different clip representations.
Clipboard::ObjectMapParam is a vector<char>, and strings and blobs (bitmaps) are being stored there.
Prior to that UTF16 strings are converted to UTF8. And after that to vector<char>.
What is the expected result?
Ideally, none conversions should be done... at most one.
Clipboard::ObjectMapParam could be a union of:
- std::string: for utf8 strings
- base::string16: for utf16 strings
- vector<uint8_t>: for blobs
And to avoid further conversions, Clipboard::WriteToHTML() could use a base::string16 instead of a char*, and internally the different clipboards should represent the markup in base::string16 instead of std::string
Comment 1 by benhenry@chromium.org
, Aug 1