зеркало из https://github.com/mozilla/gecko-dev.git
Bug 484121 (3/6) - Get rid of nsIDTD::Will{Resume,Interrupt}Parse. r+sr=mrbkap
This commit is contained in:
Родитель
be66be8cc9
Коммит
cf8369dfe8
|
@ -128,22 +128,6 @@ public:
|
|||
*/
|
||||
NS_IMETHOD HandleToken(CToken* aToken,nsIParser* aParser) = 0;
|
||||
|
||||
/**
|
||||
* If the parse process gets interrupted midway, this method is
|
||||
* called by the parser prior to resuming the process.
|
||||
* @update gess5/18/98
|
||||
* @return ignored
|
||||
*/
|
||||
NS_IMETHOD WillResumeParse(nsIContentSink* aSink) = 0;
|
||||
|
||||
/**
|
||||
* If the parse process gets interrupted, this method is called by
|
||||
* the parser to notify the DTD that interruption will occur.
|
||||
* @update gess5/18/98
|
||||
* @return ignored
|
||||
*/
|
||||
NS_IMETHOD WillInterruptParse(nsIContentSink* aSink) = 0;
|
||||
|
||||
/**
|
||||
* This method is called to determine whether or not a tag of one
|
||||
* type can contain a tag of another type.
|
||||
|
@ -193,8 +177,6 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIDTD, NS_IDTD_IID)
|
|||
NS_IMETHOD DidBuildModel(nsresult anErrorCode,PRBool aNotifySink,nsIParser* aParser,nsIContentSink* aSink);\
|
||||
NS_IMETHOD BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,nsITokenObserver* anObserver,nsIContentSink* aSink);\
|
||||
NS_IMETHOD HandleToken(CToken* aToken,nsIParser* aParser);\
|
||||
NS_IMETHOD WillResumeParse(nsIContentSink* aSink = 0);\
|
||||
NS_IMETHOD WillInterruptParse(nsIContentSink* aSink = 0);\
|
||||
NS_IMETHOD_(PRBool) CanContain(PRInt32 aParent,PRInt32 aChild) const;\
|
||||
NS_IMETHOD_(PRBool) IsContainer(PRInt32 aTag) const;\
|
||||
NS_IMETHOD_(void) Terminate();\
|
||||
|
|
|
@ -3149,32 +3149,3 @@ CNavDTD::CreateContextStackFor(eHTMLTags aParent, eHTMLTags aChild)
|
|||
HandleToken(theToken, mParser);
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
CNavDTD::WillResumeParse(nsIContentSink* aSink)
|
||||
{
|
||||
STOP_TIMER();
|
||||
MOZ_TIMER_DEBUGLOG(("Stop: Parse Time: CNavDTD::WillResumeParse(), this=%p\n", this));
|
||||
|
||||
nsresult result = aSink ? aSink->WillResume() : NS_OK;
|
||||
|
||||
MOZ_TIMER_DEBUGLOG(("Start: Parse Time: CNavDTD::WillResumeParse(), this=%p\n", this));
|
||||
START_TIMER();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
CNavDTD::WillInterruptParse(nsIContentSink* aSink)
|
||||
{
|
||||
STOP_TIMER();
|
||||
MOZ_TIMER_DEBUGLOG(("Stop: Parse Time: CNavDTD::WillInterruptParse(), this=%p\n", this));
|
||||
|
||||
nsresult result = aSink ? aSink->WillInterrupt() : NS_OK;
|
||||
|
||||
MOZ_TIMER_DEBUGLOG(("Start: Parse Time: CNavDTD::WillInterruptParse(), this=%p\n", this));
|
||||
START_TIMER();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -1333,18 +1333,6 @@ nsExpatDriver::WillTokenize(PRBool aIsFinalChunk,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsExpatDriver::WillResumeParse(nsIContentSink* aSink)
|
||||
{
|
||||
return aSink ? aSink->WillResume() : NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsExpatDriver::WillInterruptParse(nsIContentSink* aSink)
|
||||
{
|
||||
return aSink ? aSink->WillInterrupt() : NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsExpatDriver::DidTokenize(PRBool aIsFinalChunk)
|
||||
{
|
||||
|
|
|
@ -2228,7 +2228,7 @@ nsParser::ResumeParse(PRBool allowIteration, PRBool aIsFinalChunk,
|
|||
}
|
||||
|
||||
if (mDTD) {
|
||||
mDTD->WillResumeParse(mSink);
|
||||
mSink->WillResume();
|
||||
PRBool theIterationIsOk = PR_TRUE;
|
||||
|
||||
while (result == NS_OK && theIterationIsOk) {
|
||||
|
@ -2265,10 +2265,7 @@ nsParser::ResumeParse(PRBool allowIteration, PRBool aIsFinalChunk,
|
|||
// If we're told to block the parser, we disable all further parsing
|
||||
// (and cache any data coming in) until the parser is re-enabled.
|
||||
if (NS_ERROR_HTMLPARSER_BLOCK == result) {
|
||||
if (mDTD) {
|
||||
mDTD->WillInterruptParse(mSink);
|
||||
}
|
||||
|
||||
mSink->WillInterrupt();
|
||||
if (mFlags & NS_PARSER_FLAG_PARSER_ENABLED) {
|
||||
// If we were blocked by a recursive invocation, don't re-block.
|
||||
BlockParser();
|
||||
|
@ -2324,7 +2321,7 @@ nsParser::ResumeParse(PRBool allowIteration, PRBool aIsFinalChunk,
|
|||
result = mInternalState;
|
||||
aIsFinalChunk = mParserContext &&
|
||||
mParserContext->mStreamListenerState == eOnStop;
|
||||
// ...then intentionally fall through to WillInterruptParse()...
|
||||
// ...then intentionally fall through to mSink->WillInterrupt()...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2332,9 +2329,7 @@ nsParser::ResumeParse(PRBool allowIteration, PRBool aIsFinalChunk,
|
|||
if (theTokenizerResult == kEOF ||
|
||||
result == NS_ERROR_HTMLPARSER_INTERRUPTED) {
|
||||
result = (result == NS_ERROR_HTMLPARSER_INTERRUPTED) ? NS_OK : result;
|
||||
if (mDTD) {
|
||||
mDTD->WillInterruptParse(mSink);
|
||||
}
|
||||
mSink->WillInterrupt();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -608,35 +608,6 @@ CViewSourceHTML::GetMode() const
|
|||
return eDTDMode_full_standards;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @update gess5/18/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
NS_IMETHODIMP CViewSourceHTML::WillResumeParse(nsIContentSink* aSink){
|
||||
nsresult result = NS_OK;
|
||||
if(mSink) {
|
||||
result = mSink->WillResume();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @update gess5/18/98
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
NS_IMETHODIMP CViewSourceHTML::WillInterruptParse(nsIContentSink* aSink){
|
||||
nsresult result = NS_OK;
|
||||
if(mSink) {
|
||||
result = mSink->WillInterrupt();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by the parser to enable/disable dtd verification of the
|
||||
* internal context stack.
|
||||
|
|
Загрузка…
Ссылка в новой задаче