Closed Bug 1347639 Opened 3 years ago Closed 3 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
Tracking Status
firefox55 --- fixed

People

(Reporter: smaug, Assigned: bzbarsky)

References

Details

(Whiteboard: [qf-])

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: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.