Bug 1411893 - Introduce nsStaticAtom. r=emilio,froydnj.

It's a sub-class of nsAtom, useful for cases where you know you are dealing
exclusively with static atoms. The nice thing about it is that you can use
raw nsStaticAtom pointers instead of RefPtr<>. (In fact, the AddRef/Release
implementations ensure that we'll crash if we use RefPtr<nsStaticAtom>.)

MozReview-Commit-ID: 4Q6QHX5h44V
This commit is contained in:
Nicholas Nethercote
2017-10-27 10:31:13 +11:00
parent 7e48a97e73
commit 465f16fc67
32 changed files with 122 additions and 100 deletions

View File

@@ -50,7 +50,7 @@ nsHtml5AtomTable::GetAtom(const nsAString& aKey)
return cachedAtom;
}
nsAtom* atom = NS_GetStaticAtom(aKey);
nsStaticAtom* atom = NS_GetStaticAtom(aKey);
if (atom) {
mRecentlyUsedParserAtoms[index] = atom;
return atom;