nsIToolkitProfileService.profileCount should return the number of profiles

RESOLVED FIXED in Firefox 60

Status

()

enhancement
RESOLVED FIXED
Last year
Last year

People

(Reporter: mossop, Assigned: mossop)

Tracking

unspecified
mozilla60
Points:
---

Firefox Tracking Flags

(firefox60 fixed)

Details

Attachments

(1 attachment)

This bizarre API is just asking for confusion. Let's make it sane.

Comment 2

Last year
mozreview-review
Comment on attachment 8951363 [details]
Bug 1438615: profileCount should actually return the number of profiles.

https://reviewboard.mozilla.org/r/220620/#review227458

::: toolkit/profile/nsToolkitProfileService.cpp:960
(Diff revision 1)
>  NS_IMETHODIMP
>  nsToolkitProfileService::GetProfileCount(uint32_t *aResult)
>  {
> -    if (!mFirst)
> -        *aResult = 0;
> +    *aResult = 0;
> -    else if (! mFirst->mNext)
> +    nsToolkitProfile* profile = mFirst.get();

Why do you need the .get() calls here?

A few lines later there's the same code implemented as simply:

    for (cur = mFirst; cur != nullptr; cur = cur->mNext)
        ++pCount;
Comment hidden (mozreview-request)
Assignee

Comment 4

Last year
mozreview-review-reply
Comment on attachment 8951363 [details]
Bug 1438615: profileCount should actually return the number of profiles.

https://reviewboard.mozilla.org/r/220620/#review227458

> Why do you need the .get() calls here?
> 
> A few lines later there's the same code implemented as simply:
> 
>     for (cur = mFirst; cur != nullptr; cur = cur->mNext)
>         ++pCount;

Can't remember why I did that. Seems to work fine without it. Updated the patch.

Comment 5

Last year
mozreview-review
Comment on attachment 8951363 [details]
Bug 1438615: profileCount should actually return the number of profiles.

https://reviewboard.mozilla.org/r/220620/#review227574
Attachment #8951363 - Flags: review?(florian) → review+

Comment 6

Last year
Pushed by dtownsend@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c4420500cda8
profileCount should actually return the number of profiles. r=florian

Comment 7

Last year
bugherder
https://hg.mozilla.org/mozilla-central/rev/c4420500cda8
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.