summaryrefslogtreecommitdiffstats
path: root/xpcom/ds/nsIAtom.idl
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-06-29 22:58:52 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-06-29 22:58:52 +0200
commite09746b2f34ce69c7bc4c86b1f90f62b7c8d9c51 (patch)
treef8d4d2b62b2bcd2f5b37ce7cbf6fa873cff185b0 /xpcom/ds/nsIAtom.idl
parentbfb36627c66ff8a27da7c1bace60496352fd096b (diff)
parente4b2fa17baea1d35d80de19ffb90d9ba2a1033f8 (diff)
downloadUXP-e09746b2f34ce69c7bc4c86b1f90f62b7c8d9c51.tar
UXP-e09746b2f34ce69c7bc4c86b1f90f62b7c8d9c51.tar.gz
UXP-e09746b2f34ce69c7bc4c86b1f90f62b7c8d9c51.tar.lz
UXP-e09746b2f34ce69c7bc4c86b1f90f62b7c8d9c51.tar.xz
UXP-e09746b2f34ce69c7bc4c86b1f90f62b7c8d9c51.zip
Merge branch 'master' into Pale_Moon-release
# Conflicts: # application/palemoon/config/version.txt # security/manager/ssl/nsSTSPreloadList.errors # security/manager/ssl/nsSTSPreloadList.inc
Diffstat (limited to 'xpcom/ds/nsIAtom.idl')
-rw-r--r--xpcom/ds/nsIAtom.idl15
1 files changed, 13 insertions, 2 deletions
diff --git a/xpcom/ds/nsIAtom.idl b/xpcom/ds/nsIAtom.idl
index c02540838..ce4cff485 100644
--- a/xpcom/ds/nsIAtom.idl
+++ b/xpcom/ds/nsIAtom.idl
@@ -37,9 +37,15 @@ interface nsIAtom : nsISupports
size_t SizeOfIncludingThis(in MallocSizeOf aMallocSizeOf);
%{C++
- // note this is NOT virtual so this won't muck with the vtable!
+ // note these are NOT virtual so they won't muck with the vtable!
+ inline bool Equals(char16ptr_t aString, uint32_t aLength) const
+ {
+ return mLength == aLength &&
+ memcmp(mString, aString, mLength * sizeof(char16_t)) == 0;
+ }
+
inline bool Equals(const nsAString& aString) const {
- return aString.Equals(nsDependentString(mString, mLength));
+ return Equals(aString.BeginReading(), aString.Length());
}
inline bool IsStaticAtom() const {
@@ -120,6 +126,11 @@ extern already_AddRefed<nsIAtom> NS_Atomize(const char16_t* aUTF16String);
extern already_AddRefed<nsIAtom> NS_Atomize(const nsAString& aUTF16String);
/**
+ * An optimized version of the method above for the main thread.
+ */
+extern already_AddRefed<nsIAtom> NS_AtomizeMainThread(const nsAString& aUTF16String);
+
+/**
* Return a count of the total number of atoms currently
* alive in the system.
*/