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)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

Details

Attachments

(1 file)

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: nobody → continuation
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 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+
(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.
https://hg.mozilla.org/mozilla-central/rev/5e9824ba465b
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: