Closed
Bug 1186790
Opened 10 years ago
Closed 10 years ago
Replace nsBaseHashtable::EnumerateRead() calls in xpfe/ with iterators
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
mozilla45
| Tracking | Status | |
|---|---|---|
| firefox45 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
Attachments
(1 file)
|
2.93 KB,
patch
|
neil
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #1186787 +++
Because iterators are so much nicer than enumerate functions.
There is one occurrence of EnumerateRead() in this directory.
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()).
| Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8681758 -
Flags: review?(neil)
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Comment 2•10 years ago
|
||
Comment on attachment 8681758 [details] [diff] [review]
Replace nsBaseHashtable::EnumerateRead() calls in xpfe/ with iterators
[Ugh, this code doesn't clear its outparam. I guess nobody actually looks up a non-existent window.]
>- return PL_DHASH_STOP;
Nit: You could break out of your loop when you find the resource.
>+ if (resource == windowResource.get()) {
[As you're changing this anyway, the .get() is probably unnecessary and could be removed.]
>- if (docShell) {
>- nsCOMPtr<nsIDOMWindow> result = do_GetInterface(docShell);
>+ if (docShell) {
>+ nsCOMPtr<nsIDOMWindow> result = do_GetInterface(docShell);
[do_GetInterface is null-safe, so the check isn't actually necessary.]
>- *aResult = result;
>- NS_IF_ADDREF(*aResult);
>+ *aResult = result;
>+ NS_IF_ADDREF(*aResult);
[Might be worth updating this to use result.forget(aResult); rather than the explicit AddRef.]
Attachment #8681758 -
Flags: review?(neil) → review+
| Assignee | ||
Comment 3•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e1d1d11909a4feceb354c9ba8fdbbdb840aeaf73
Bug 1186790 - Replace nsBaseHashtable::EnumerateRead() calls in xpfe/ with iterators. r=neil.
Comment 4•10 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Comment 5•7 years ago
|
||
Moving to Core:XUL per https://bugzilla.mozilla.org/show_bug.cgi?id=1455336
Component: XP Toolkit/Widgets: XUL → XUL
You need to log in
before you can comment on or make changes to this bug.
Description
•