Closed
Bug 1212148
Opened 9 years ago
Closed 9 years ago
Eliminate call to do_CreateInstance(NS_VARIANT_CONTRACTID) in CreateVoidVariant
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: mccr8, Assigned: mccr8)
Details
Attachments
(1 file)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
In bug 1210517, I'm eliminating all calls to do_CreateInstance(NS_VARIANT_CONTRACTID) in favor of calling new nsVariant() directly. The one remaining instance after the patch in that bug is in CreateVoidVariant, because I didn't want to add a new #include to nsGlobalWindow.h. The easiest fix is probably to outline CreateVoidVariant into nsGlobalWindow.cpp. If the performance is even actually an issue here, you'd still be replacing a virtual call with a static one, so I'd think you'd still be ahead. I'm not really sure why this little method actually even exists. It looks like bholley added it in bug 860941.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → continuation
Assignee | ||
Comment 1•9 years ago
|
||
I also eliminated the static because a static method in a header seems weird.
try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=ea2d0d9c982e
Attachment #8670820 -
Flags: review?(bzbarsky)
Comment 2•9 years ago
|
||
Comment on attachment 8670820 [details] [diff] [review]
Outline CreateVoidVariant and create the variant directly.
How about you make CreateVoidVariant a static method in nsGlobalWindow.cpp and put DialogValueHolder::Get() out of line?
r=me with that
Attachment #8670820 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 4•9 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #2)
> How about you make CreateVoidVariant a static method in nsGlobalWindow.cpp
> and put DialogValueHolder::Get() out of line?
That's a lot nicer; thanks for the suggestion.
Comment 5•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•