Closed Bug 1186780 Opened 9 years ago Closed 9 years ago

Use some new hashtable iterators

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42

People

(Reporter: khuey, Assigned: khuey)

References

Details

Attachments

(3 files)

I might not get to this review this week; I have a huge review backlog already. :(
Comment on attachment 8637720 [details] [diff] [review] DOM Moving down the list of people who start with b ...
Attachment #8637720 - Flags: review?(bzbarsky) → review?(bkelly)
Comment on attachment 8637721 [details] [diff] [review] Cycle collection Review of attachment 8637721 [details] [diff] [review]: ----------------------------------------------------------------- nice
Attachment #8637721 - Flags: review?(continuation) → review+
Comment on attachment 8637720 [details] [diff] [review] DOM Review of attachment 8637720 [details] [diff] [review]: ----------------------------------------------------------------- I must admit the diff algorithm gave some hard to read hunks for the macro changes in nsDocument.cpp, but I think this is correct. Just a couple questions and nit. Also, please remember to update the bug number and reviewer in the commit message. Thanks. ::: dom/base/nsDocument.cpp @@ +2034,5 @@ > if (tmp->mAnimationController) { > tmp->mAnimationController->Unlink(); > } > > + tmp->MaybeClearBoxObjectTable(); Any particular reason you moved clearing the box table further down in the steps here? This used to take place after: NS_IMPL_CYCLE_COLLECTION_UNLINK(mPreloadingImages) @@ +3779,5 @@ > + return; > + } > + > + for (auto iter = mBoxObjectTable->ConstIter(); !iter.Done(); iter.Next()) { > + if (auto boxObject = iter.UserData()) { nit: I personally prefer to see the variable declaration on a separate line. Assignment in an if-statement seems to favor cleverness over clarity. Here and elsewhere in the patch. This is a style thing, though, so I won't make you change it if you greatly prefer this. @@ +10607,5 @@ > > // Otherwise, iterate over our images and perform the appropriate action. > + for (auto iter = mImageTracker.ConstIter(); !iter.Done(); iter.Next()) { > + imgIRequest* image = iter.Key(); > + if (aLocked) { Are these methods particularly hot? It seems you've moved an if-check inside a for loop which could have some perf impact.
Attachment #8637720 - Flags: review?(bkelly) → review+
(In reply to Ben Kelly [:bkelly] from comment #7) > Any particular reason you moved clearing the box table further down in the > steps here? This used to take place after: Nope, fixed. > nit: I personally prefer to see the variable declaration on a separate line. > Assignment in an if-statement seems to favor cleverness over clarity. Here > and elsewhere in the patch. > > This is a style thing, though, so I won't make you change it if you greatly > prefer this. I really like that style, so I've left it as is. > Are these methods particularly hot? It seems you've moved an if-check > inside a for loop which could have some perf impact. Excellent question. These functions are called when the presshell is frozen or thawed, or when the active state of the docshell changes. None of those should happen frequently, and none of them are performance sensitive to the level at which a branch would affect them.
Flags: needinfo?(khuey)
The problem is in the DOM patch, so I've relanded the cycle collector one.
Flags: needinfo?(khuey)
Comment on attachment 8637719 [details] [diff] [review] ImageLoader I wonder if this pattern (twice) is really needed: >+ auto key = iter.Key(); >+ imgIRequest* request = static_cast<imgIRequest*>(key); >+ auto key = iter.Key(); >+ imgIRequest* request = static_cast<imgIRequest*>(key); Otherwise, r=dbaron
Attachment #8637719 - Flags: review?(dbaron) → review+
Status: NEW → RESOLVED
Closed: 9 years ago
Keywords: leave-open
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: