summaryrefslogtreecommitdiffstats
path: root/dom/base/Element.cpp
diff options
context:
space:
mode:
authorwin7-7 <win7-7@users.noreply.github.com>2019-05-24 13:56:08 +0300
committerGitHub <noreply@github.com>2019-05-24 13:56:08 +0300
commita3434ba005b8eaa52fdcdfc3392b640f25f10410 (patch)
tree0017eeb028077818311e39526b41f7adfe60f707 /dom/base/Element.cpp
parent315ffd563c18442e655e815bf250acce84b9b232 (diff)
downloadUXP-a3434ba005b8eaa52fdcdfc3392b640f25f10410.tar
UXP-a3434ba005b8eaa52fdcdfc3392b640f25f10410.tar.gz
UXP-a3434ba005b8eaa52fdcdfc3392b640f25f10410.tar.lz
UXP-a3434ba005b8eaa52fdcdfc3392b640f25f10410.tar.xz
UXP-a3434ba005b8eaa52fdcdfc3392b640f25f10410.zip
add main thread only cache for nsIAtoms to speed up atomization dom/base
add main thread only cache for nsIAtoms to speed up atomization
Diffstat (limited to 'dom/base/Element.cpp')
-rw-r--r--dom/base/Element.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp
index 5c3277e84..f787e4d21 100644
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -1283,7 +1283,7 @@ Element::ToggleAttribute(const nsAString& aName,
if (aForce.WasPassed() && !aForce.Value()) {
return false;
}
- nsCOMPtr<nsIAtom> nameAtom = NS_Atomize(nameToUse);
+ nsCOMPtr<nsIAtom> nameAtom = NS_AtomizeMainThread(nameToUse);
if (!nameAtom) {
aError.Throw(NS_ERROR_OUT_OF_MEMORY);
return false;
@@ -1398,7 +1398,7 @@ Element::GetAttributeNS(const nsAString& aNamespaceURI,
return;
}
- nsCOMPtr<nsIAtom> name = NS_Atomize(aLocalName);
+ nsCOMPtr<nsIAtom> name = NS_AtomizeMainThread(aLocalName);
bool hasAttr = GetAttr(nsid, name, aReturn);
if (!hasAttr) {
SetDOMStringToNull(aReturn);
@@ -1430,7 +1430,7 @@ Element::RemoveAttributeNS(const nsAString& aNamespaceURI,
const nsAString& aLocalName,
ErrorResult& aError)
{
- nsCOMPtr<nsIAtom> name = NS_Atomize(aLocalName);
+ nsCOMPtr<nsIAtom> name = NS_AtomizeMainThread(aLocalName);
int32_t nsid =
nsContentUtils::NameSpaceManager()->GetNameSpaceID(aNamespaceURI,
nsContentUtils::IsChromeDoc(OwnerDoc()));
@@ -1518,7 +1518,7 @@ Element::HasAttributeNS(const nsAString& aNamespaceURI,
return false;
}
- nsCOMPtr<nsIAtom> name = NS_Atomize(aLocalName);
+ nsCOMPtr<nsIAtom> name = NS_AtomizeMainThread(aLocalName);
return HasAttr(nsid, name);
}