summaryrefslogtreecommitdiffstats
path: root/parser/html/nsHtml5MetaScannerCppSupplement.h
diff options
context:
space:
mode:
authorwin7-7 <win7-7@users.noreply.github.com>2019-07-05 21:58:21 +0300
committerwin7-7 <win7-7@users.noreply.github.com>2019-07-05 21:58:21 +0300
commit7c5a0db237c7a43136ee3cdc6cfb0663778d9e2c (patch)
tree9cd5a806763b73bed3fef3d599f32b525f4c0d7a /parser/html/nsHtml5MetaScannerCppSupplement.h
parent0e54a032624b4ce23a959454047bfd504a734cc0 (diff)
downloadUXP-7c5a0db237c7a43136ee3cdc6cfb0663778d9e2c.tar
UXP-7c5a0db237c7a43136ee3cdc6cfb0663778d9e2c.tar.gz
UXP-7c5a0db237c7a43136ee3cdc6cfb0663778d9e2c.tar.lz
UXP-7c5a0db237c7a43136ee3cdc6cfb0663778d9e2c.tar.xz
UXP-7c5a0db237c7a43136ee3cdc6cfb0663778d9e2c.zip
Introduce a new non-heap-allocated type for holding nsStringBuffer* in the HTML parser.
An innerHTML setter profile shows about 10% of the time being spent under nsHtml5HtmlAttributes::clear, mostly deleting nsStrings.
Diffstat (limited to 'parser/html/nsHtml5MetaScannerCppSupplement.h')
-rw-r--r--parser/html/nsHtml5MetaScannerCppSupplement.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/parser/html/nsHtml5MetaScannerCppSupplement.h b/parser/html/nsHtml5MetaScannerCppSupplement.h
index 5e7033777..9d2496361 100644
--- a/parser/html/nsHtml5MetaScannerCppSupplement.h
+++ b/parser/html/nsHtml5MetaScannerCppSupplement.h
@@ -19,13 +19,15 @@ nsHtml5MetaScanner::sniff(nsHtml5ByteReadable* bytes, nsACString& charset)
}
bool
-nsHtml5MetaScanner::tryCharset(nsString* charset)
+nsHtml5MetaScanner::tryCharset(nsHtml5String charset)
{
// This code needs to stay in sync with
// nsHtml5StreamParser::internalEncodingDeclaration. Unfortunately, the
// trickery with member fields here leads to some copy-paste reuse. :-(
nsAutoCString label;
- CopyUTF16toUTF8(*charset, label);
+ nsString charset16; // Not Auto, because using it to hold nsStringBuffer*
+ charset.ToString(charset16);
+ CopyUTF16toUTF8(charset16, label);
nsAutoCString encoding;
if (!EncodingUtils::FindEncodingForLabel(label, encoding)) {
return false;