Bug 384898: Cleanup nsScanner. r=mrbkap, sr=jst

git-svn-id: svn://10.0.0.236/trunk@228788 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sharparrow1%yahoo.com
2007-06-27 00:21:47 +00:00
parent 9676b09bdf
commit 9057c0b45b
6 changed files with 37 additions and 412 deletions

View File

@@ -1280,43 +1280,6 @@ nsParser::Parse(nsIURI* aURL,
return result;
}
/**
* Cause parser to parse input from given stream
*/
NS_IMETHODIMP
nsParser::Parse(nsIInputStream* aStream,
const nsACString& aMimeType,
void* aKey,
nsDTDMode aMode)
{
nsresult result = NS_ERROR_OUT_OF_MEMORY;
// Ok, time to create our tokenizer and begin the process
nsAutoString theUnknownFilename(NS_LITERAL_STRING("unknown"));
nsScanner* theScanner = new nsScanner(theUnknownFilename, aStream, mCharset,
mCharsetSource);
CParserContext* pc = new CParserContext(theScanner, aKey, mCommand, 0);
if (pc && theScanner) {
PushContext(*pc);
pc->SetMimeType(aMimeType);
pc->mStreamListenerState = eOnStart;
pc->mMultipart = PR_FALSE;
pc->mContextType = CParserContext::eCTStream;
pc->mDTDMode = aMode;
mParserContext->mScanner->FillBuffer();
result = ResumeParse();
pc = PopContext();
delete pc;
} else {
result = mInternalState = NS_ERROR_HTMLPARSER_BADCONTEXT;
}
return result;
}
/**
* Call this method if all you want to do is parse 1 string full of HTML text.
* In particular, this method should be called by the DOM when it has an HTML