Closed Bug 962241 Opened 10 years ago Closed 10 years ago

stop NS_ENSURE_SUCCESS spam from ContractIDToCID call added in bug 959485

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file)

This hunk from bug 959485:

-        if (registrar) {
-            nsCID *cid;
-            if (NS_SUCCEEDED(registrar->ContractIDToCID(str, &cid))) {
-                success = idObj->mDetails.InitWithName(*cid, str);
-                nsMemory::Free(cid);
-            }
-        }
+        NS_ENSURE_TRUE(registrar, nullptr);
+
+        nsCID *cid;
+        NS_ENSURE_SUCCESS(registrar->ContractIDToCID(str, &cid), nullptr);
+        bool success = idObj->mDetails.InitWithName(*cid, str);
+        nsMemory::Free(cid);
+        if (!success)
+            return nullptr;

now complains when ContractIDToCID fails, whereas the previous version did not.  And ContractIDToCID appears to fail a fair amount on mochitest runs.  A chosen-at-random mochitest-2 run contains ~750K of log spam (4k+ messages about this call failure) for no reason.  Let's restore the not-complaining behavior.
Just expanding out NS_ENSURE_SUCCESS, essentially.  My console is slightly
less cluttered now.  (The messages seem to be significantly more common when
compiling locally, which also makes them significantly more annoying.)
Attachment #8363205 - Flags: review?(bobbyholley+bmo)
It's also worth noting that this particular NS_ENSURE_SUCCESS is now responsible for ~70% of the NS_ENSURE_SUCCESS spam in a mochitest-2 log on TBPL.
Attachment #8363205 - Flags: review?(bobbyholley+bmo) → review+
Assignee: nobody → nfroyd
https://hg.mozilla.org/mozilla-central/rev/b61eed44de3a
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: