The default bug view has changed. See this FAQ.

nsStringArraySH::GetProperty copies string to js, but it could probably share it

RESOLVED FIXED

Status

()

Core
DOM
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: smaug, Assigned: smaug)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Assignee)

Description

6 years ago
.
(Assignee)

Comment 1

6 years ago
Created attachment 532169 [details]
testcase
(Assignee)

Updated

6 years ago
Assignee: nobody → Olli.Pettay
(Assignee)

Comment 2

6 years ago
Created attachment 532185 [details] [diff] [review]
wip

Uploaded to tryserver.

While I was looking at this code, I removed one QI in nsDOMTokenListSH::GetStringAt.

We may want to add some helper method which does all the ForgetSharedBuffer
thing. Or perhaps the last parameter of ReadableToJSVal should be
boolean to indicate whether it is ok to call ForgetSharedBuffer.
(Assignee)

Comment 3

6 years ago
Created attachment 532206 [details] [diff] [review]
without QI change

The QI removal doesn't apparently work, so this is just about the
string handling optimization.
(Assignee)

Comment 4

6 years ago
(The QI optimization fails because I forgot the code is used also for nsDOMSettableTokenList)
(Assignee)

Updated

6 years ago
Attachment #532206 - Flags: review?(bzbarsky)
Comment on attachment 532206 [details] [diff] [review]
without QI change

r=me
Attachment #532206 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 6

6 years ago
http://hg.mozilla.org/mozilla-central/rev/5d5f2f15037b
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.