Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen

MozReview-Commit-ID: GF0YXDwfA14
This commit is contained in:
Masatoshi Kimura
2017-06-18 20:37:50 +09:00
parent 8ddaccacfb
commit cff1fdcb48
81 changed files with 584 additions and 450 deletions

View File

@@ -99,19 +99,15 @@ nsHtml5Parser::SetCommand(eParserCommands aParserCommand)
"Parser command was not eViewNormal.");
}
NS_IMETHODIMP_(void)
nsHtml5Parser::SetDocumentCharset(const nsACString& aCharset,
void
nsHtml5Parser::SetDocumentCharset(NotNull<const Encoding*> aEncoding,
int32_t aCharsetSource)
{
NS_PRECONDITION(!mExecutor->HasStarted(),
"Document charset set too late.");
NS_PRECONDITION(GetStreamParser(), "Setting charset on a script-only parser.");
nsAutoCString trimmed;
trimmed.Assign(aCharset);
trimmed.Trim(" \t\r\n\f");
GetStreamParser()->SetDocumentCharset(trimmed, aCharsetSource);
mExecutor->SetDocumentCharsetAndSource(trimmed,
aCharsetSource);
GetStreamParser()->SetDocumentCharset(aEncoding, aCharsetSource);
mExecutor->SetDocumentCharsetAndSource(aEncoding, aCharsetSource);
}
NS_IMETHODIMP