And remove unreachable code after MOZ_CRASH().
MozReview-Commit-ID: 6ShBtPRKYlF
--HG--
extra : rebase_source : 0fe45a59411bda663828336e2686707b550144ae
extra : source : 8473fd7333d2abe1ea1cc176510c292a5b34df45
Now that xpcom strings use templates we can combine their `ArenaStrdup`
implementations. `nsTStringRepr` is used so as to allow handling of both
`nsTLiteralString` and `nsTSubstring` types.
--HG--
extra : rebase_source : e77891da589f320507b45f524a3203b3dc9f38e6
extra : histedit_source : 79d3b9a1add191563e0985f0c0e416bd29f24351
This adds support for duplicating both raw `char*` strings and raw `char16_t*`
strings by making the character type generic.
--HG--
extra : rebase_source : bb5245ed71161c8c785684e5a56ac894f03874ea
extra : histedit_source : e94eb738a3982f0cb63a894a0cdfbdf0be2b9cad
Renames are because another location also defined that
variable. Unused definitions are eliminated.
The .eslintrc.js file makes eslint expect XPCShell global variables.
MozReview-Commit-ID: Fafm5o45bme
--HG--
extra : rebase_source : ab71132a60e90bd30f34766bd828b18dd608f8b3
These were generated with |./mach eslint --fix xpcom| with the
.eslintignore and xpcom/tests/unit/.eslintrc.js changes from the next
patch.
MozReview-Commit-ID: 8pKkICSK3JQ
--HG--
extra : rebase_source : bbc98050928f27160d8ca63d38aa0c383be95878
This is non-standard, and eslint can't parse it correctly, so remove
it.
MozReview-Commit-ID: EsfZSyoECB0
--HG--
extra : rebase_source : 561d194e0c466d98d054b2303916be196f983b1b
(Path is actually r=froydnj.)
Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.
MozReview-Commit-ID: 91U22X2NydP
--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
(patch is actually r=erahm,mystor)
nsTFixedString<T> is only used as a base class for nsTAutoStringN<T, N>, so
this patch merges the former into the latter, cutting some code and simplifying
the string class hierarchy.
Because the "Fixed" name is now gone, the patch also renames
StringDataFlags::FIXED as INLINE and ClassDataFlags::FIXED as INLINE.
The patch also removes nsFixed[C]String and ns_auto_[c]string! from Rust code
because nsAutoString can't be implemented directly in Rust due to its move
semantics. There were only two uses of ns_auto_string! outside of tests so this
seems like a minor loss.
MozReview-Commit-ID: 8ntximghiut
--HG--
extra : rebase_source : f36edbae0553adcfee356fb8b311097ff7424786
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.
These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.
- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>
- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
- Count() --> Length()
- ObjectAt() --> ElementAt()
- AppendObject() --> AppendElement()
- RemoveObjectAt() --> RemoveElementAt()
- ns*Hashtable<nsISupportsHashKey, ...> -->
ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>
- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
- This requires adding a Get() method to nsRefPtrHashtable that it lacks but
nsInterfaceHashtable has.
- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
- nsArrayBase::Create() --> nsTArray()
- GetLength() --> Length()
- do_QueryElementAt() --> operator[]
The patch also has some changes to Rust code that manipulates nsIAtom.
MozReview-Commit-ID: DykOl8aEnUJ
--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1
The NS_LITERAL_CSTRING macro creates a temporary nsLiteralCString to encapsulate the string literal and its length, but AssignLiteral() can determine the string literal's length at compile-time without nsLiteralCString.
MozReview-Commit-ID: B5Y8KyExPQ8
--HG--
extra : rebase_source : e27b266c145daa5acd887e998c6d5b408101e1db
extra : source : 33f49977a33cbdb1c7127871b940eefccc018f65
This patch reduces sizeof(PLDHashTable) as follows.
- 64-bit: from 40 bytes to 32
- 32-bit: from 28 bytes to 20
It does this by doing the following.
- It moves mGeneration from EntryStore to PLDHashTable, to avoid unnecessary
padding on 64-bit. This requires tweaking EntryStore::Set() as explained in a
comment.
- It also shrinks mGeneration from uint32_t to uint16_t, saving 2 bytes of
data.
- It shrinks mEntrySize from uint32_t to uint8_t, to cut 3 bytes of data.
- It shrinks mHashShift from int16_t to uint8_t, trimming another byte of data,
and moves it, saving another 2 bytes of padding.
And it reorders the fields so the word-sized ones are at the start, which makes
it easier to imagine the memory layout.
The patch also adds a test, and fixes some misordered function arguments in
existing tests.
--HG--
extra : rebase_source : 6ed6f7be68477fd4a82f07dd2f51c1f1d9b92dcc
Bug 1388789 introduced a bug breaking formats like "%*.f". The problem
was that the next "natural" argument was taken before the "*" width
argument.
MozReview-Commit-ID: BZack9faY7a
--HG--
extra : rebase_source : a14485914ef9e29e38f29be6c1df1372ce5e722f
nsTextFormatter unconditionally emitted a trailing \0, leading some code
elsewhere to have to work around this. This changes the code to only
emit it in snprintf.
MozReview-Commit-ID: G3CBpAPp9Tn
--HG--
extra : rebase_source : 36666476a4f796e2553c9fa31daa54d245ae3b5f
Change nsTextFormatter functions to template functions, box their
arguments, and then make the formatter mostly impervious to type
mismatches. Most formatting is done according to the type of the actual
argument.
MozReview-Commit-ID: H8WmyxFCb7s
--HG--
extra : rebase_source : ad98ad6243825f1a892fc6a641d155e239b12a6b
nsTextFormatter tried to pass unrecognized escapes in the format string
through to the output. However, if the format held a width or
precision, that text was not output. It seems better to me to try to
preserve the format text as-is.
MozReview-Commit-ID: HoBykpfzK7C
--HG--
extra : rebase_source : 9b071db3800e3e75cabb4995a920818dfb35b03d
This is a preexisting issue that makes nsMultiplexInputStream multiple-inherit
from nsIInputStream: once via nsIMultipartInputStream and once via
nsIAsyncInputStream. This causes problems once we end up with more multiplex
streams that are async streams, because then some assingments to
nsCOMPtr<nsIInputStream> start asserting. This patch just removes the footgun
by getting rid of the multiple inheritance.
This is a preexisting issue that makes nsMultiplexInputStream multiple-inherit
from nsIInputStream: once via nsIMultipartInputStream and once via
nsIAsyncInputStream. This causes problems once we end up with more multiplex
streams that are async streams, because then some assingments to
nsCOMPtr<nsIInputStream> start asserting. This patch just removes the footgun
by getting rid of the multiple inheritance.
Its return value is never used, and most implementations return nullptr anyway.
MozReview-Commit-ID: 8rxC053mmE8
--HG--
extra : rebase_source : 61a0b8b1373396182efd27d3c01b96e5e5541364