Closed Bug 1347639 Opened 7 years ago Closed 7 years ago

nsImageLoadingContent::UpdateImageState shouldn't do useless QIs

Categories

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

50 Branch
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Performance Impact none
Tracking Status
firefox55 --- fixed

People

(Reporter: smaug, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

Obvious options are:

1)  A virtual IsContent() that subclasses override.
2)  An nsIContent* ctor arg subclasses pass in and we store, at the cost of an extra word of memory.
Whiteboard: [qf-]
MozReview-Commit-ID: 9sE3pbHwYbV
Attachment #8847959 - Flags: review?(kyle)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment on attachment 8847959 [details] [diff] [review]
Add nsImageLoadingContent::AsContent to make getting the relevant nsIContent* faster

Review of attachment 8847959 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/html/HTMLObjectElement.h
@@ +253,5 @@
>    void StartObjectLoad(bool aNotify, bool aForceLoad);
>  
> +protected:
> +  // Override for nsImageLoadingContent.
> +  nsIContent* AsContent() override { return this; }  

Nit: trailing whitespace, here and a few other headers
Attachment #8847959 - Flags: review?(kyle) → review+
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/cc19d7604b6e
Add nsImageLoadingContent::AsContent to make getting the relevant nsIContent* faster.  r=qdot
https://hg.mozilla.org/mozilla-central/rev/cc19d7604b6e
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Component: DOM → DOM: Core & HTML
Performance Impact: --- → -
Whiteboard: [qf-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: