Closed
Bug 1182981
Opened 10 years ago
Closed 10 years ago
Use nsTHashTable::Iterator in dom/{animation,indexedDB}/
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla42
Tracking | Status | |
---|---|---|
firefox42 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: birtles)
References
Details
Attachments
(4 files, 2 obsolete files)
3.90 KB,
patch
|
n.nethercote
:
review+
birtles
:
checkin+
|
Details | Diff | Splinter Review |
4.16 KB,
patch
|
khuey
:
review+
n.nethercote
:
feedback+
birtles
:
checkin+
|
Details | Diff | Splinter Review |
5.60 KB,
patch
|
n.nethercote
:
review+
birtles
:
checkin+
|
Details | Diff | Splinter Review |
4.39 KB,
patch
|
n.nethercote
:
review+
birtles
:
checkin+
|
Details | Diff | Splinter Review |
Because iterators are so much nicer than enumerate functions.
There are ten occurrences of EnumerateEntries() in dom/{animation,indexedDB}/ to be dealt with.
Assignee | ||
Comment 1•10 years ago
|
||
I'll take care of PendingAnimationTracker and AnimationTimeline which accounts for 5 occurrences.
Reporter | ||
Updated•10 years ago
|
Assignee: nobody → bbirtles
Reporter | ||
Comment 2•10 years ago
|
||
(In reply to Brian Birtles (:birtles) from comment #1)
> I'll take care of PendingAnimationTracker and AnimationTimeline which
> accounts for 5 occurrences.
Want to do the indexedDB ones as well? They're pretty mechanical and easy :) If not, can you please file a spin-off bug for indexedDB and rename this one? Thank you.
Assignee | ||
Comment 3•10 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #2)
> Want to do the indexedDB ones as well?
Sure, no problem.
Assignee | ||
Comment 4•10 years ago
|
||
Assignee | ||
Comment 5•10 years ago
|
||
Assignee | ||
Comment 6•10 years ago
|
||
Assignee | ||
Comment 7•10 years ago
|
||
Assignee | ||
Comment 8•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
Reporter | ||
Comment 9•10 years ago
|
||
Comment on attachment 8633272 [details] [diff] [review]
part 1 - Use nsTHashtable::Iterator in PendingAnimationTracker
Review of attachment 8633272 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/animation/PendingAnimationTracker.h
@@ +75,5 @@
> const AnimationSet& aSet) const;
>
> + static void TriggerAnimationsAtTime(AnimationSet& aAnimationSet,
> + const TimeStamp& aReadyTime);
> + static void TriggerAndClearAnimations(AnimationSet& aSet);
Do these need to be class methods? If not, I'd be inclined to put them entirely within PendingAnimationTracker.cpp, like TriggerAnimationAtTime() and TriggerAnimationNow() were, just to avoid exposing unnecessary details in the header file. (Note that the old functions should have been marked as |static|.)
Attachment #8633272 -
Flags: review+
Reporter | ||
Updated•10 years ago
|
Attachment #8633273 -
Flags: review+
Assignee | ||
Comment 10•10 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #9)
> Comment on attachment 8633272 [details] [diff] [review]
> part 1 - Use nsTHashtable::Iterator in PendingAnimationTracker
>
> Review of attachment 8633272 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: dom/animation/PendingAnimationTracker.h
> @@ +75,5 @@
> > const AnimationSet& aSet) const;
> >
> > + static void TriggerAnimationsAtTime(AnimationSet& aAnimationSet,
> > + const TimeStamp& aReadyTime);
> > + static void TriggerAndClearAnimations(AnimationSet& aSet);
>
> Do these need to be class methods? If not, I'd be inclined to put them
> entirely within PendingAnimationTracker.cpp, like TriggerAnimationAtTime()
> and TriggerAnimationNow() were, just to avoid exposing unnecessary details
> in the header file. (Note that the old functions should have been marked as
> |static|.)
Initially I did that, but the AnimationSet typedef is defined within the scope of PendingAnimationTracker so it was just easier to make them class scope. I suppose I could just redefine that inside PendingAnimationTracker.cpp
Reporter | ||
Updated•10 years ago
|
Attachment #8633275 -
Flags: review+
Reporter | ||
Comment 11•10 years ago
|
||
Comment on attachment 8633274 [details] [diff] [review]
part 3 - Use nsTHashtable::Iterator in ActorsParent
Review of attachment 8633274 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me except that I'm not sure about the AssertIsOnBackgroundThread() call in NoteFinishedTransaction(). The obvious thing to do it to put it just before the iterator loop, but as we discussed on IRC it's not clear if that's necessary given that there is a AssertIsOnOwningThread() call at the start of that function. I'll let someone who knows this code better decide.
Attachment #8633274 -
Flags: feedback+
Assignee | ||
Comment 12•10 years ago
|
||
Comment on attachment 8633274 [details] [diff] [review]
part 3 - Use nsTHashtable::Iterator in ActorsParent
Ben, do you mind looking at this? The main part I'm not sure about is what to do with the AssertIsOnBackgroundThread(). Do we need it in addition to the AssertIsOnOwningThread() at the start of the method? Or is one of the two enough?
Attachment #8633274 -
Flags: review?(bent.mozilla)
Comment 13•10 years ago
|
||
(In reply to Brian Birtles (:birtles) from comment #10)
> Initially I did that, but the AnimationSet typedef is defined within the
> scope of PendingAnimationTracker so it was just easier to make them class
> scope. I suppose I could just redefine that inside
> PendingAnimationTracker.cpp
Another option would be to use lamda functions. E.g.:
void
PendingAnimationTracker::TriggerPendingAnimationsOnNextTick(...)
{
auto triggerAnimationAtTime = [](...) {
};
triggerAnimationAtTime(...);
}
Assignee | ||
Comment 14•10 years ago
|
||
(In reply to Birunthan Mohanathas [:poiru] from comment #13)
> Another option would be to use lamda functions. E.g.:
>
> void
> PendingAnimationTracker::TriggerPendingAnimationsOnNextTick(...)
> {
> auto triggerAnimationAtTime = [](...) {
> };
>
> triggerAnimationAtTime(...);
> }
Oh, neat. I didn't even think of that.
Assignee | ||
Comment 15•10 years ago
|
||
Hi Nicholas, care to have a quick look at this again? I replaced the class scope static methods with lambda functions as suggested by Birunthan. Other than that it should be identical to the previous patch.
Attachment #8633301 -
Flags: review?(n.nethercote)
Assignee | ||
Updated•10 years ago
|
Attachment #8633272 -
Attachment is obsolete: true
Assignee | ||
Comment 16•10 years ago
|
||
Sorry, slight simplification. Still new to lambdas.
Attachment #8633303 -
Flags: review?(n.nethercote)
Assignee | ||
Updated•10 years ago
|
Attachment #8633301 -
Attachment is obsolete: true
Attachment #8633301 -
Flags: review?(n.nethercote)
Reporter | ||
Comment 17•10 years ago
|
||
Comment on attachment 8633303 [details] [diff] [review]
part 1 - Use nsTHashtable::Iterator in PendingAnimationTracker
Review of attachment 8633303 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/animation/PendingAnimationTracker.cpp
@@ +51,5 @@
> void
> PendingAnimationTracker::TriggerPendingAnimationsOnNextTick(const TimeStamp&
> aReadyTime)
> {
> + auto triggerAnimationsAtTime = [aReadyTime](AnimationSet& aAnimationSet) {
Call this triggerAnimationsAtReadyTime?
Attachment #8633303 -
Flags: review?(n.nethercote) → review+
Reporter | ||
Comment 18•10 years ago
|
||
birtles: bent just stopped working for Mozilla and I'm not sure what his reviewing status is right now.
Comment 19•10 years ago
|
||
Comment on attachment 8633274 [details] [diff] [review]
part 3 - Use nsTHashtable::Iterator in ActorsParent
I think janv should review this.
Attachment #8633274 -
Flags: review?(bent.mozilla) → review?(Jan.Varga)
Comment 20•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Attachment #8633273 -
Flags: checkin+
Assignee | ||
Updated•10 years ago
|
Attachment #8633303 -
Flags: checkin+
Assignee | ||
Updated•10 years ago
|
Attachment #8633275 -
Flags: checkin+
Attachment #8633274 -
Flags: review?(Jan.Varga) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: leave-open
Comment 22•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Attachment #8633274 -
Flags: checkin+
Comment 23•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b7b704a33d93
https://hg.mozilla.org/mozilla-central/rev/f5237a8342b1
https://hg.mozilla.org/mozilla-central/rev/def8fc96ab63
https://hg.mozilla.org/mozilla-central/rev/a4dd53b2940a
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•