Bug 1347737 - Introduce a new non-heap-allocated type for holding nsStringBuffer* in the HTML parser. r=wchen.
MozReview-Commit-ID: Gn9fXroxQhY
This commit is contained in:
@@ -1280,7 +1280,7 @@ nsHtml5StreamParser::PreferredForInternalEncodingDecl(nsACString& aEncoding)
|
||||
}
|
||||
|
||||
bool
|
||||
nsHtml5StreamParser::internalEncodingDeclaration(nsString* aEncoding)
|
||||
nsHtml5StreamParser::internalEncodingDeclaration(nsHtml5String aEncoding)
|
||||
{
|
||||
// This code needs to stay in sync with
|
||||
// nsHtml5MetaScanner::tryCharset. Unfortunately, the
|
||||
@@ -1290,8 +1290,10 @@ nsHtml5StreamParser::internalEncodingDeclaration(nsString* aEncoding)
|
||||
return false;
|
||||
}
|
||||
|
||||
nsString newEncoding16; // Not Auto, because using it to hold nsStringBuffer*
|
||||
aEncoding.ToString(newEncoding16);
|
||||
nsAutoCString newEncoding;
|
||||
CopyUTF16toUTF8(*aEncoding, newEncoding);
|
||||
CopyUTF16toUTF8(newEncoding16, newEncoding);
|
||||
|
||||
if (!PreferredForInternalEncodingDecl(newEncoding)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user