Closed Bug 1187782 Opened 9 years ago Closed 9 years ago

Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(14 files, 2 obsolete files)

10.09 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
3.27 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
5.73 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
3.93 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
3.04 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
1.90 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
4.88 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
5.56 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
4.69 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
5.21 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
3.30 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
3.47 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
4.71 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
5.07 KB, patch
khuey
: review+
n.nethercote
: checkin+
Details | Diff | Splinter Review
Because iterators are so much nicer than enumerate functions.

There are nine occurrences of EnumerateRead() in these directories.

A note to the assignee: to preserve existing behaviour, you should probably use
nsBaseHashtable::Iterator::UserData() rather than nsBaseHashtable::Iterator::Data(). (The latter should be used when replacing nsBaseHashtable::Enumerate()).
> There are nine occurrences of EnumerateRead() in these directories.

There are now a bunch more because some of the patches in bug 1186780 were backed out.
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Comment on attachment 8679262 [details] [diff] [review]
(part 2) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators

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

I think this would be nicer if we made a DisconnectGroupMessageManagers and called it from both places.
Attachment #8679262 - Flags: review?(khuey) → review-
Attachment #8679262 - Attachment is obsolete: true
Comment on attachment 8679264 [details] [diff] [review]
(part 5) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators

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

::: dom/base/nsDocument.cpp
@@ +7636,5 @@
> +
> +      // This non-standard style of iteration is presumably used because some
> +      // of the code in the loop body can trigger element removal, which
> +      // invalidates the iterator.
> +      while (true) {

Unfortunately I can't actually look up blame because they blew up the CVS server ...

but yes, I assume that is the concern here.  The loop obviously never exits if BlastSubtreeToPieces and UnsetAttr don't end up removing the attribute from the map.
Attachment #8679264 - Flags: review?(khuey) → review+
Keywords: leave-open
https://hg.mozilla.org/integration/mozilla-inbound/rev/14b02d1a0b2bc79e4804e12f029d477af98a22f7
Bug 1187782 (part 1) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.

https://hg.mozilla.org/integration/mozilla-inbound/rev/c46fb7b4d2a956d5c277c282bcbf0f3cec17012a
Bug 1187782 (part 2) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.

https://hg.mozilla.org/integration/mozilla-inbound/rev/78202fd2b4d525ceb48a759492df86eca1669f2a
Bug 1187782 (part 3) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.

https://hg.mozilla.org/integration/mozilla-inbound/rev/40e5654d4bdd3ed4939de46a7ad89288285c6039
Bug 1187782 (part 4) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.

https://hg.mozilla.org/integration/mozilla-inbound/rev/1e2e66bf01dbbf7d5018185e925d975aa6189786
Bug 1187782 (part 5) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.
The abandoned cases in bug 1186780 still need to be converted.
Attachment #8683457 - Attachment is obsolete: true
Attachment #8683457 - Flags: review?(khuey)
Attachment #8679261 - Flags: checkin+
Attachment #8679263 - Flags: checkin+
Attachment #8679264 - Flags: checkin+
Attachment #8679265 - Flags: checkin+
Attachment #8679781 - Flags: checkin+
https://hg.mozilla.org/integration/mozilla-inbound/rev/97aab3af2b2d1097e24fb9bb391baa3eb930d7cd
Bug 1187782 (part 6) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.

https://hg.mozilla.org/integration/mozilla-inbound/rev/22f17b724bda3bd67747a12957cd057eddacce38
Bug 1187782 (part 7) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.

https://hg.mozilla.org/integration/mozilla-inbound/rev/7a9d854faf3593509575b682caac87c84bae7a7d
Bug 1187782 (part 8) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.

https://hg.mozilla.org/integration/mozilla-inbound/rev/6011756702d34de3872314fbcb4b7c85f53b0d1b
Bug 1187782 (part 9) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.
Attachment #8682819 - Flags: checkin+
Attachment #8683456 - Flags: checkin+
Attachment #8683490 - Flags: checkin+
Attachment #8683493 - Flags: checkin+
khuey: thank you for the reviews. Your penance for abandoning bug 1186780 is now complete :)
https://hg.mozilla.org/integration/mozilla-inbound/rev/973e6cc74295021ff49cd28a6c78ef15bfb50a09
Bug 1187782 (part 10) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.

https://hg.mozilla.org/integration/mozilla-inbound/rev/e24122a5c63636a63bc0145bf76045a70523509e
Bug 1187782 (part 11) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.
Attachment #8684713 - Flags: checkin+
Attachment #8684714 - Flags: checkin+
https://hg.mozilla.org/integration/mozilla-inbound/rev/9a138819046955099a8ea10a9d885ca1444edacd
Bug 1187782 (part 12) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.

https://hg.mozilla.org/integration/mozilla-inbound/rev/696889d8782c8429145aeddddb5d4a3e79ee04bb
Bug 1187782 (part 13) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.

https://hg.mozilla.org/integration/mozilla-inbound/rev/bc19fde35da4ed6f26dad8ff371f291931840e4e
Bug 1187782 (part 14) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.
Keywords: leave-open
Attachment #8684715 - Flags: checkin+
Attachment #8684716 - Flags: checkin+
Attachment #8684717 - Flags: checkin+
https://hg.mozilla.org/mozilla-central/rev/9a1388190469
https://hg.mozilla.org/mozilla-central/rev/696889d8782c
https://hg.mozilla.org/mozilla-central/rev/bc19fde35da4
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: