remove uses of nsIEnumerator from PSM

RESOLVED FIXED in Firefox 47

Status

()

defect
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: keeler, Assigned: Cykesiopka)

Tracking

({addon-compat})

Trunk
mozilla47
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox45 affected, firefox47 fixed)

Details

Attachments

(1 attachment)

The comment in nsIEnumerator.idl indicates it should not be used:

/*
 * DO NOT USE THIS INTERFACE.  IT IS HORRIBLY BROKEN, USES NS_COMFALSE
 * AND IS BASICALLY IMPOSSIBLE TO USE CORRECTLY THROUGH PROXIES OR
 * XPCONNECT.  IF YOU SEE NEW USES OF THIS INTERFACE IN CODE YOU ARE
 * REVIEWING, YOU SHOULD INSIST ON nsISimpleEnumerator.
 *
 * DON'T MAKE ME COME OVER THERE.
 */

ಠ_ಠ
Assignee

Updated

3 years ago
Assignee: nobody → cykesiopka.bmo
Status: NEW → ASSIGNED
Attachment #8722533 - Flags: review?(dkeeler) → review+
Comment on attachment 8722533 [details]
MozReview Request: Bug 1220237 - Remove uses of nsIEnumerator from PSM. r=keeler

https://reviewboard.mozilla.org/r/36077/#review33037

This looks great. I just had a few comments on the tests.

::: security/manager/ssl/tests/unit/test_pkcs11_list.js:19
(Diff revision 1)
> +function checkTestModuleMissing() {

Maybe "NotPresent" instead of "Missing"?

::: security/manager/ssl/tests/unit/test_pkcs11_list.js:70
(Diff revision 1)
> +    } catch (e) {}

Do we want to hide potential exceptions? Is the potential failure here "it was already unloaded"? Maybe we could check for that and re-throw if that's not the error.
Assignee

Comment 3

3 years ago
https://reviewboard.mozilla.org/r/36077/#review33037

Thanks for the review!

> Do we want to hide potential exceptions? Is the potential failure here "it was already unloaded"? Maybe we could check for that and re-throw if that's not the error.

Yes, the potential failure here is mainly "it was already unloaded". In particular, we delete the module near the end, so in a normal run having the cleanup code delete the module again will result in an exception being thrown. For xpcshell tests, I guess cleanup like this isn't strictly necessary, but doing so does seem like best practice. I'll add a comment explaining this.

With regards to hiding exceptions, we call deleteModule() without a try-catch at line 87, so I think we already have sufficient coverage for the method throwing unexpectedly.
Assignee

Comment 4

3 years ago
Comment on attachment 8722533 [details]
MozReview Request: Bug 1220237 - Remove uses of nsIEnumerator from PSM. r=keeler

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/36077/diff/1-2/
Attachment #8722533 - Attachment description: MozReview Request: Bug 1220237 - Remove uses of nsIEnumerator from PSM. → MozReview Request: Bug 1220237 - Remove uses of nsIEnumerator from PSM. r=keeler

Comment 7

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/63fdedf32876
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Assignee

Updated

3 years ago
Keywords: addon-compat
You need to log in before you can comment on or make changes to this bug.