зеркало из https://github.com/mozilla/gecko-dev.git
Bug 815707 - clean up cycle collector Traverse/Unlink in parser/ r=smaug
This commit is contained in:
Родитель
34a5c40864
Коммит
0bda3d7c46
|
@ -83,7 +83,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsHtml5StreamParser)
|
|||
tmp->DropTimer();
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mObserver)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mRequest)
|
||||
tmp->mOwner = nullptr;
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwner)
|
||||
tmp->mExecutorFlusher = nullptr;
|
||||
tmp->mLoadFlusher = nullptr;
|
||||
tmp->mExecutor = nullptr;
|
||||
|
@ -93,10 +93,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
|||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsHtml5StreamParser)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mObserver)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRequest)
|
||||
if (tmp->mOwner) {
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mOwner");
|
||||
cb.NoteXPCOMChild(static_cast<nsIParser*> (tmp->mOwner));
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner)
|
||||
// hack: count the strongly owned edge wrapped in the runnable
|
||||
if (tmp->mExecutorFlusher) {
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mExecutorFlusher->mExecutor");
|
||||
|
@ -109,8 +106,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsHtml5StreamParser)
|
|||
}
|
||||
// hack: count self if held by mChardet
|
||||
if (tmp->mChardet) {
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb,
|
||||
"mChardet->mObserver");
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mChardet->mObserver");
|
||||
cb.NoteXPCOMChild(static_cast<nsIStreamListener*>(tmp));
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
|
||||
using namespace mozilla;
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsHtml5TreeOpExecutor)
|
||||
NS_IMPL_CYCLE_COLLECTION_INHERITED_1(nsHtml5TreeOpExecutor, nsContentSink,
|
||||
mOwnedElements)
|
||||
|
||||
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHtml5TreeOpExecutor)
|
||||
NS_INTERFACE_TABLE_INHERITED1(nsHtml5TreeOpExecutor,
|
||||
|
@ -46,14 +47,6 @@ NS_IMPL_ADDREF_INHERITED(nsHtml5TreeOpExecutor, nsContentSink)
|
|||
|
||||
NS_IMPL_RELEASE_INHERITED(nsHtml5TreeOpExecutor, nsContentSink)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHtml5TreeOpExecutor, nsContentSink)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwnedElements)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsHtml5TreeOpExecutor, nsContentSink)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwnedElements)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
class nsHtml5ExecutorReflusher : public nsRunnable
|
||||
{
|
||||
private:
|
||||
|
|
|
@ -24,25 +24,14 @@ using mozilla::dom::EncodingUtils;
|
|||
|
||||
static NS_DEFINE_CID(kParserCID, NS_PARSER_CID);
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsSAXXMLReader)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsSAXXMLReader)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mContentHandler)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDTDHandler)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mErrorHandler)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mLexicalHandler)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mBaseURI)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mListener)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mParserObserver)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsSAXXMLReader)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mContentHandler)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDTDHandler)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mErrorHandler)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLexicalHandler)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBaseURI)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mListener)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParserObserver)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
NS_IMPL_CYCLE_COLLECTION_7(nsSAXXMLReader,
|
||||
mContentHandler,
|
||||
mDTDHandler,
|
||||
mErrorHandler,
|
||||
mLexicalHandler,
|
||||
mBaseURI,
|
||||
mListener,
|
||||
mParserObserver)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSAXXMLReader)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSAXXMLReader)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSAXXMLReader)
|
||||
|
|
Загрузка…
Ссылка в новой задаче