New issue
Advanced search Search tips

Issue 754075 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

ScopedClipboardWriter to do less UTF16toUTF8 conversions and standardize on base::string16

Project Member Reported by ricardoq@chromium.org, Aug 10 2017

Issue description

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
 
Status: Assigned (was: Untriaged)

Sign in to add a comment