Closed Bug 1453129 Opened 6 years ago Closed 6 years ago

don't needlessly copy data in nsClipboardProxy

Categories

(Core :: Widget, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file)

We're already going to copy the data when we initialize the
nsISupportsString here.  There's no need to copy the data into a
temporary object before passing it in to the nsISupportsString.

And as long as we're fixing the big mistakes, we might as well fix the
small ones, like copying the flavor string from the IPC object.
Comment on attachment 8966729 [details] [diff] [review]
don't needlessly copy data in nsClipboardProxy

Is IPC layer not using nsStringBuffers? If so, that is something to fix.

But we can do this anyhow.
Attachment #8966729 - Flags: review?(bugs) → review+
(In reply to Olli Pettay [:smaug] (only webcomponents and event handling reviews, please) from comment #2)
> Comment on attachment 8966729 [details] [diff] [review]
> don't needlessly copy data in nsClipboardProxy
> 
> Is IPC layer not using nsStringBuffers? If so, that is something to fix.

Oh, that's true, we'd just increment a refcnt here.  OK, so it's not a huge win, but it looks nicer. :)
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/67758cf8ae6f
don't needlessly copy data in nsClipboardProxy; r=smaug
https://hg.mozilla.org/mozilla-central/rev/67758cf8ae6f
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: