Closed Bug 1375698 Opened 7 years ago Closed 7 years ago

Cleanup nsDocument::GetBoxObjectFor

Categories

(Core :: XUL, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: perf)

Attachments

(2 files)

We can replace do_CreateInstance(contractID) with "new BoxObject",
remove unnecessary error handling since "new" is infallible.
Also, use RefPtr<BoxObject> for the mBoxObjectTable hashtable because
that's what's stored there, not some abstract nsPIBoxObject.
Blocks: 1375696
Using #ifdef MOZ_XUL mostly as "this can be removed some day".
I doubt our code actually builds without it currently.
Attachment #8880633 - Flags: review?(bzbarsky)
Comment on attachment 8880633 [details] [diff] [review]
part 1 - Call "new BoxObject" instead of do_CreateInstance(contractID) and remove some unnecessary error handling since "new" is infallible

r=me.  Thank you for doing this.

We might want a followup to get rid of all this contractid/CID/NS_New* gunk for box objects, after 57 ships.
Attachment #8880633 - Flags: review?(bzbarsky) → review+
Comment on attachment 8880634 [details] [diff] [review]
part 2 - Make mBoxObjectTable a nsRefPtrHashtable of BoxObject instead of nsInterfaceHashtable of nsPIBoxObject (that we then need to downcast)

r=me
Attachment #8880634 - Flags: review?(bzbarsky) → review+
(In reply to Boris Zbarsky [:bz] (if a patch has no decent message, automatic r-) from comment #4)
> We might want a followup to get rid of all this contractid/CID/NS_New* gunk
> for box objects, after 57 ships.

Filed bug 1376125.
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c9213679fdcf
part 1 - Call "new BoxObject" instead of do_CreateInstance(contractID) and remove some unnecessary error handling since "new" is infallible.  r=bz
https://hg.mozilla.org/integration/mozilla-inbound/rev/c9f4980873ab
part 2 - Make mBoxObjectTable a nsRefPtrHashtable of BoxObject instead of nsInterfaceHashtable of nsPIBoxObject (that we then need to downcast).  r=bz
https://hg.mozilla.org/mozilla-central/rev/c9213679fdcf
https://hg.mozilla.org/mozilla-central/rev/c9f4980873ab
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: