nsImageLoadingContent::UpdateImageState shouldn't do useless QIs

RESOLVED FIXED in Firefox 55

Status

()

Core
DOM
RESOLVED FIXED
11 months ago
10 months ago

People

(Reporter: smaug, Assigned: bz)

Tracking

50 Branch
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

(Whiteboard: [qf-])

Attachments

(1 attachment)

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-]
Created attachment 8847959 [details] [diff] [review]
Add nsImageLoadingContent::AsContent to make getting the relevant nsIContent* faster

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+

Comment 4

10 months ago
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

Comment 5

10 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/cc19d7604b6e
Status: ASSIGNED → RESOLVED
Last Resolved: 10 months ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.