nsHtml5Atoms are very similar to dynamic nsAtoms. This patch removes the former
in favour of the latter, which leaves nsAtom as the only subclass of nsIAtom.
nsAtom::mKind is still used to distinguish dynamic atoms from HTML5 atoms, and
the HTML5 parser still uses manual memory management to handle its HTML5 atoms.
nsHtml5AtomEntry::mAtom had to be changed from an nsAutoPtr to a raw pointer
because nsAtom's destructor is private.
MozReview-Commit-ID: 1pBzwkog3ut
--HG--
extra : rebase_source : fbb819e527cb30606348da9ce3eede62e00fb936
This patch moves nsAtom's declaration to nsIAtom.h. In order to keep most of
nsAtom's members private the patch also does the following.
- It introduces a new class, nsAtomFriend, which encapsulates the functions
that will need access to nsAtom's private members.
- It moves GCKind, GCAtomTable(), and GCAtomTableLocked() out of nsAtom.
- It removes the factory methods, and replaces their uses with direct
constructor calls.
MozReview-Commit-ID: L8vfrHsR2cS
--HG--
extra : rebase_source : d38a65515ae82c355966ca80ab235bea11b638af
Because it's going to be exposed via nsIAtom.h in the next few patches.
MozReview-Commit-ID: A81s1nWrvmB
--HG--
extra : rebase_source : 43990feb460fc7343c994f72fb6c6679a3aeb1cc
Full specialization is allowed in MSVC, but not in gcc.
MozReview-Commit-ID: 9QI6YWc5Rvr
--HG--
extra : rebase_source : 7387899a6d76832afbe15e088b80a82adee59ca3
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
Removes the nsIDOMHTMLObjectElement XPCOM interface, replacing it with
HTMLObjectElement and FromContent conversion usage.
MozReview-Commit-ID: dmsjSO97uh
--HG--
extra : rebase_source : 9b2c25b8681f754bc34233afccdb6fc5d38f0804
XPCOM's string API doesn't have the notion of a "null string". But it does have
the notion of a "void string" (or "voided string"), and that's what these
functions are returning. So the names should reflect that.
--HG--
extra : rebase_source : 4e3f982e0873877174a08a25413595ff66f7d20e
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
The current code replaces one PLDHashTable's mGeneration with another. If the
two generation values happen to be equal, it will look as though the storage
hasn't changed when really it has.
The fix is to use EntryStore::Set() to update mEntryStore, which increments
mGeneration appropriately.
--HG--
extra : rebase_source : d1779a143746c8d1a3e67bc3685e703496206b0f
nsIHandleReportCallback, typedef of nsIMemoryReporterCallback, has been the
preferred name for a long time and is used in most places. This patch removes
nsIMemoryReporterCallback.
--HG--
extra : rebase_source : c675076b4f98d93d96235dad890e31e0b0e6c277
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
Defining get() in the declaration of nsThreadManager implicitly sticks
an "inline" on the function, which is not what we want: inlining it
spreads around a lot of static initialization code. Providing an
out-of-line definition is much better in terms of code size.
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
The char* and char16_t* cases handled null strings differently;
normalize them to both emit "(null)".
MozReview-Commit-ID: IzRkc3pSSjl
--HG--
extra : rebase_source : f43a1a852a2c8aa3d6607c7202f7cd42fdd5740a
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::vsnprintf is defined to return uint32_t(-1) on error.
However, it was not doing this.
nsTextFormatter::vssprintf is defined as infallible; enforce this by
having it return void.
MozReview-Commit-ID: LdOhIHzRvAT
--HG--
extra : rebase_source : 7164eb47a89ecebfa50d40684eea1325de0172ba
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
nsTextFormatter used nsAutoString for arrays of hex digits; but this
didn't seem to provide any benefit.
MozReview-Commit-ID: EYHtnAzJL8h
--HG--
extra : rebase_source : 6906075f06478b7c10229201de46e36d08d1f7f8
The runtime type-checking rewrite of nsTextFormatter will not support
va_list uses. So, make these functions private and fix the sole user.
MozReview-Commit-ID: IBWALVzIcHC
--HG--
extra : rebase_source : a822697c81c1a054359fc2ecd894d51f95686548
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.
The compiler complains because a postfix increment is done inside of an assert.
MozReview-Commit-ID: LSRsWMn9Tlj
--HG--
extra : rebase_source : 18539a430c3d84675c602699be9a5a62dd477fec
By doing this we avoid triggering assertions in the Servo code that ensure
we have registered the thread with Servo and set the proper state on it.
MozReview-Commit-ID: K6qHrYoQDLm
--HG--
extra : rebase_source : d01b0aad42273f6b92b7cfd5f5fe17ffe7b4cda0
Unfortunately, this needed some additional trickery in order to keep its
constructor "private". I stole this trick from [1]. With this patch, we tear
down the statistics object during XPCOM shutdown intead of after it. I don't
believe that we need the object to live past the ClearOnShutdown destructors.
[1] http://rienajouter.blogspot.com/2014/10/makeshared-and-makeunique-for-classes.html
MozReview-Commit-ID: JsiN6Bq9Yp4
--HG--
extra : rebase_source : dd26c8e6906a6c9fd500c28379f8c63fd7c3ad6a