Closed Bug 1667713 Opened 5 years ago Closed 5 years ago

Clean up nsresult values

Categories

(Core :: XPCOM, task)

task

Tracking

()

RESOLVED WONTFIX

People

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

Details

Attachments

(14 obsolete files)

The existence of any success codes other than NS_OK annoys me. Some can easily be removed.

We also have some duplicate constants, some of which appear intentional, and some which do not.

It has a single use that can be replaced with NS_OK without any other changes.

It's unused.

Depends on D91548

Its uses can be replaced with NS_OK without any other changes.

Depends on D91549

Both constants have the same value! They can be replaced by NS_OK without
effect.

Depends on D91550

It has four constants, three of which are unused.

The one used constant is NS_RDF_NO_VALUE, which sounds like a failure code but
is actually a success code. It's only used in one place, on a failure path. But
the function that uses it has a single call site, and the return value is not
checked, which means that the NS_RDF_NO_VALUE use is never checked.

I have replaced this one use of NS_RDF_NO_VALUE with NS_ERROR_FAILURE rather
than NS_OK, because that makes more sense for a failure path.

Depends on D91551

It's a low-value synonym of NS_OK that isn't used in mozilla-central.

Depends on D91552

It's a low-value synonym of NS_OK that isn't used.

Depends on D91553

It's a low-value synonym of NS_ERROR_INVALID_ARG.

Depends on D91554

It's a deprecated and potentially confusing synonym of
NS_ERROR_UDEC_ILLEGALINPUT.

Depends on D91555

I have included an allow-list because there are some existing dups. Some look
reasonable, some don't.

Depends on D91556

It's never checked for, so NS_OK is good enough.

The commit also fixes the typo in GetNextPrevLineFromeBlockFrame().

Depends on D91705

As NS_OK_UENC_NPMAPPING, because it's a success code!

Depends on D91706

It's a low-value synonym for NS_OK.

Depends on D91707

Attachment #9178151 - Attachment description: Bug 1667713 - Remove NS_SUCCESS_{DONT_FIXUP,RESTART_APP}. r=nika → Bug 1667713 - Remove NS_SUCCESS_RESTART_APP. r=nika

It's unused.

Depends on D91708

Attachment #9178150 - Attachment is obsolete: true

These changes ended up being more subtle than expected, with a higher chance of introducing regressions that I originally thought. (E.g. because some success codes have no explicit uses, but do have implicit uses.) Combine that with the fact that I was only able to remove some of the non-NS_OK success codes, rather than all of them as I originally hoped... I think the cautious thing is to give up on these.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
Attachment #9178148 - Attachment is obsolete: true
Attachment #9178149 - Attachment is obsolete: true
Attachment #9178151 - Attachment is obsolete: true
Attachment #9178152 - Attachment is obsolete: true
Attachment #9178153 - Attachment is obsolete: true
Attachment #9178154 - Attachment is obsolete: true
Attachment #9178156 - Attachment is obsolete: true
Attachment #9178157 - Attachment is obsolete: true
Attachment #9178394 - Attachment is obsolete: true
Attachment #9178395 - Attachment is obsolete: true
Attachment #9178396 - Attachment is obsolete: true
Attachment #9178397 - Attachment is obsolete: true
Attachment #9178654 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: