mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1163192 - Part 2: Wrap expensive calls in PR_LOG_TEST. r=froydnj
Check that logging is enabled before performing potentially expensive operations.
This commit is contained in:
parent
c60880a777
commit
6fef0f25d9
@ -157,27 +157,29 @@ txStylesheet::findTemplate(const txXPathNode& aNode,
|
||||
}
|
||||
}
|
||||
|
||||
nsAutoString mode, nodeName;
|
||||
if (aMode.mLocalName) {
|
||||
aMode.mLocalName->ToString(mode);
|
||||
}
|
||||
txXPathNodeUtils::getNodeName(aNode, nodeName);
|
||||
if (matchTemplate) {
|
||||
nsAutoString matchAttr;
|
||||
if (PR_LOG_TEST(txLog::xslt, PR_LOG_DEBUG)) {
|
||||
nsAutoString mode, nodeName;
|
||||
if (aMode.mLocalName) {
|
||||
aMode.mLocalName->ToString(mode);
|
||||
}
|
||||
txXPathNodeUtils::getNodeName(aNode, nodeName);
|
||||
if (matchTemplate) {
|
||||
nsAutoString matchAttr;
|
||||
#ifdef TX_TO_STRING
|
||||
match->toString(matchAttr);
|
||||
match->toString(matchAttr);
|
||||
#endif
|
||||
PR_LOG(txLog::xslt, PR_LOG_DEBUG,
|
||||
("MatchTemplate, Pattern %s, Mode %s, Node %s\n",
|
||||
NS_LossyConvertUTF16toASCII(matchAttr).get(),
|
||||
NS_LossyConvertUTF16toASCII(mode).get(),
|
||||
NS_LossyConvertUTF16toASCII(nodeName).get()));
|
||||
}
|
||||
else {
|
||||
PR_LOG(txLog::xslt, PR_LOG_DEBUG,
|
||||
("No match, Node %s, Mode %s\n",
|
||||
NS_LossyConvertUTF16toASCII(nodeName).get(),
|
||||
NS_LossyConvertUTF16toASCII(mode).get()));
|
||||
PR_LOG(txLog::xslt, PR_LOG_DEBUG,
|
||||
("MatchTemplate, Pattern %s, Mode %s, Node %s\n",
|
||||
NS_LossyConvertUTF16toASCII(matchAttr).get(),
|
||||
NS_LossyConvertUTF16toASCII(mode).get(),
|
||||
NS_LossyConvertUTF16toASCII(nodeName).get()));
|
||||
}
|
||||
else {
|
||||
PR_LOG(txLog::xslt, PR_LOG_DEBUG,
|
||||
("No match, Node %s, Mode %s\n",
|
||||
NS_LossyConvertUTF16toASCII(nodeName).get(),
|
||||
NS_LossyConvertUTF16toASCII(mode).get()));
|
||||
}
|
||||
}
|
||||
|
||||
if (!matchTemplate) {
|
||||
|
Loading…
Reference in New Issue
Block a user