Closed Bug 852118 Opened 11 years ago Closed 11 years ago

Speed up window.name

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: jandem, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

See bug 851109 for why this matters.

(Boris Zbarsky (:bz) from bug 851109 comment #3)
> That looks like update() calling FetchName calling
> js_NativeGet calling js::Shape::get calling nsIDOMWindow_GetName which then
> has to do all the unwrapping and call nsGlobalWindow::GetName, which is
> implemented in a moronic way (e.g. involves some extra malloc/free crap). 
> That part we can fix pretty easily, I think.  Worth filing a bug on that,
> blocking this one.
This fixes the malloc-fest.  Further improvement would have to come from WebIDL bindings for Window, looks like.
Attachment #726249 - Flags: review?(bugs)
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Comment on attachment 726249 [details] [diff] [review]
Stop window.name being malloc-happy.

uh, this old code from 1999-12-03 is...

nsWindowWatcher::OpenWindowInternal is tiny bit ugly.
Perhaps   
   if (windowNeedsName) {
     if (nameSpecified && !name.LowerCaseEqualsLiteral("_blank")) {
       newDocShellItem->SetName(name);
     } else {
       newDocShellItem->SetName(EmptyString());
     }   
   }
Attachment #726249 - Flags: review?(bugs) → review+
Done.
http://hg.mozilla.org/integration/mozilla-inbound/rev/b1af382d5750
Flags: in-testsuite-
Whiteboard: [need review]
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: