Closed
Bug 1503577
Opened 6 years ago
Closed 6 years ago
Remove more nsPrimitiveHelpers::CreateDataFromPrimitive usage
Categories
(Core :: Widget, enhancement)
Core
Widget
Tracking
()
RESOLVED
FIXED
mozilla65
People
(Reporter: evilpie, Assigned: evilpie)
References
Details
Attachments
(2 files)
CreateDataFromPrimitive is a bad abstraction. It gives you back raw bytes, that are either 8-bit chars or 16-bit chars. Some callers even rely on the function returning char16_t, because they know that CreateDataFromPrimitive only returns 8bit chars for kTextMime or kCustomTypesMime flavors.
Assignee | ||
Comment 1•6 years ago
|
||
The previous |if (data)| check is not quite the same as !data.IsEmpty(), because the previous code just checked if the do_QueryInterface failed, but not if the resulting string is empty.
Assignee | ||
Updated•6 years ago
|
Keywords: leave-open
Assignee | ||
Comment 2•6 years ago
|
||
Right now CreateDataFromPrimitive doesn't use the aDataLen parameter, and after this change the out value should be the same as the value passed in, as long as we are dealing with strings.
Assignee | ||
Updated•6 years ago
|
Attachment #9021686 -
Flags: review?(spohl.mozilla.bugs)
Assignee | ||
Updated•6 years ago
|
Attachment #9022148 -
Flags: review?(mstange)
Updated•6 years ago
|
Attachment #9022148 -
Flags: review?(mstange)
Updated•6 years ago
|
Attachment #9021686 -
Flags: review?(spohl.mozilla.bugs) → review+
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/2df61d7610d6 Remove CreateDataFromPrimitive from macOS clipboard code. r=spohl https://hg.mozilla.org/integration/autoland/rev/8b1dc4b08aab Change CreateDataFromPrimitive aDataLen to out parameter with size of string in bytes. r=mstange
Comment 4•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2df61d7610d6 https://hg.mozilla.org/mozilla-central/rev/8b1dc4b08aab
Assignee | ||
Updated•6 years ago
|
Status: NEW → RESOLVED
Closed: 6 years ago
Keywords: leave-open
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in
before you can comment on or make changes to this bug.
Description
•