Open
Bug 905756
Opened 11 years ago
Updated 2 years ago
unify common function names between APIs
Categories
(Core :: XPCOM, defect)
Tracking
()
NEW
People
(Reporter: mmc, Unassigned)
Details
I am constantly tripping up between using .Data() and .get() for nsACString vs nsAutoString, and likewise .Count() and .GetLength() for nsCOMArray and nsIArray and probably many more. I'm not sure if this falls in the purview of MFBT, but it sure would be nice to have unified APIs so that developers don't have to waste time or mental energy accommodating for these differences.
Comment 1•11 years ago
|
||
The functions/classes you name are XPCOM, so this probably belongs there.
Component: MFBT → XPCOM
Comment 2•11 years ago
|
||
.Data() can be used just fine for nsAutoString, or indeed any string. .get() has totally different behavior from .Data(). Specifically, it guarantees null-termination. That's why there are two different APIs: they do different things. nsCOMArray should just be removed, and we have bugs on that.
Comment 3•11 years ago
|
||
nsCOMArray should not be removed unless we can prove that nsTArray<nsCOMPtr> has the same codesize benefits (it did not when I last measured). Bug 493711 made nsCOMArray support the same basic method names as nsTArray, I think. nsIArray is probably not changeable given the addon-compat issues.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•