Make document classes use QI tables as possible. Bug 408403, r+sr+a=jst

This commit is contained in:
bzbarsky@mit.edu 2007-12-14 21:43:10 -08:00
Родитель c5bda6fea1
Коммит 3873a2fe8d
5 изменённых файлов: 63 добавлений и 52 удалений

Просмотреть файл

@ -336,14 +336,14 @@ nsDOMStyleSheetList::~nsDOMStyleSheetList()
}
}
// XXX couldn't we use the GetIIDs method from CSSStyleSheetList here?
// QueryInterface implementation for nsDOMStyleSheetList
NS_INTERFACE_MAP_BEGIN(nsDOMStyleSheetList)
NS_INTERFACE_MAP_ENTRY(nsIDOMStyleSheetList)
NS_INTERFACE_MAP_ENTRY(nsIDocumentObserver)
NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMStyleSheetList)
NS_INTERFACE_TABLE_HEAD(nsDOMStyleSheetList)
NS_INTERFACE_TABLE3(nsDOMStyleSheetList,
nsIDOMStyleSheetList,
nsIDocumentObserver,
nsIMutationObserver)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(DocumentStyleSheetList)
NS_INTERFACE_MAP_END
@ -885,35 +885,38 @@ nsDocument::~nsDocument()
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDocument)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDocument)
NS_INTERFACE_MAP_ENTRY(nsINode)
NS_INTERFACE_MAP_ENTRY(nsIDocument)
NS_INTERFACE_MAP_ENTRY(nsIDOMDocument)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSDocument)
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOM3DocumentEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentStyle)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSDocumentStyle)
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentView)
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentRange)
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentTraversal)
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentXBL)
NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal)
NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
NS_INTERFACE_MAP_ENTRY(nsIDOM3EventTarget)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSEventTarget)
NS_INTERFACE_MAP_ENTRY(nsIDOMNode)
NS_INTERFACE_MAP_ENTRY(nsPIDOMEventTarget)
NS_INTERFACE_MAP_ENTRY(nsIDOM3Node)
NS_INTERFACE_MAP_ENTRY(nsIDOM3Document)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_ENTRY(nsIRadioGroupContainer)
NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
// nsNodeSH::PreCreate() depends on the identity pointer being the
// same as nsINode (which nsIDocument inherits), so if you change
// the below line, make sure nsNodeSH::PreCreate() still does the
// right thing!
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDocument)
NS_INTERFACE_TABLE_HEAD(nsDocument)
NS_INTERFACE_TABLE_BEGIN
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsINode)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDocument)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocument)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNSDocument)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentEvent)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOM3DocumentEvent)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentStyle)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNSDocumentStyle)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentView)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentRange)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentTraversal)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentXBL)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIScriptObjectPrincipal)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMEventTarget)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOM3EventTarget)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNSEventTarget)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNode)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsPIDOMEventTarget)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOM3Node)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOM3Document)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsISupportsWeakReference)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIRadioGroupContainer)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIMutationObserver)
// nsNodeSH::PreCreate() depends on the identity pointer being the
// same as nsINode (which nsIDocument inherits), so if you change
// the below line, make sure nsNodeSH::PreCreate() still does the
// right thing!
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(nsDocument, nsISupports, nsIDocument)
NS_INTERFACE_TABLE_END
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsDocument)
if (aIID.Equals(NS_GET_IID(nsIDOMXPathEvaluator)) ||
aIID.Equals(NS_GET_IID(nsIXPathEvaluatorInternal))) {
if (!mXPathEvaluatorTearoff) {

Просмотреть файл

@ -266,11 +266,13 @@ nsImageDocument::~nsImageDocument()
NS_IMPL_ADDREF_INHERITED(nsImageDocument, nsMediaDocument)
NS_IMPL_RELEASE_INHERITED(nsImageDocument, nsMediaDocument)
NS_INTERFACE_MAP_BEGIN(nsImageDocument)
NS_INTERFACE_MAP_ENTRY(nsIImageDocument)
NS_INTERFACE_MAP_ENTRY(imgIDecoderObserver)
NS_INTERFACE_MAP_ENTRY(imgIContainerObserver)
NS_INTERFACE_MAP_ENTRY(nsIDOMEventListener)
NS_INTERFACE_TABLE_HEAD(nsImageDocument)
NS_INTERFACE_TABLE_INHERITED4(nsImageDocument,
nsIImageDocument,
imgIDecoderObserver,
imgIContainerObserver,
nsIDOMEventListener)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(ImageDocument)
NS_INTERFACE_MAP_END_INHERITING(nsMediaDocument)

Просмотреть файл

@ -57,9 +57,11 @@ nsSVGDocument::~nsSVGDocument()
//----------------------------------------------------------------------
// nsISupports methods:
NS_INTERFACE_MAP_BEGIN(nsSVGDocument)
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGDocument)
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentEvent)
NS_INTERFACE_TABLE_HEAD(nsSVGDocument)
NS_INTERFACE_TABLE_INHERITED2(nsSVGDocument,
nsIDOMSVGDocument,
nsIDOMDocumentEvent)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(SVGDocument)
NS_INTERFACE_MAP_END_INHERITING(nsXMLDocument)

Просмотреть файл

@ -200,10 +200,12 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsXMLDocument, nsDocument)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
// QueryInterface implementation for nsXMLDocument
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXMLDocument)
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
NS_INTERFACE_MAP_ENTRY(nsIChannelEventSink)
NS_INTERFACE_MAP_ENTRY(nsIDOMXMLDocument)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsXMLDocument)
NS_INTERFACE_TABLE_INHERITED3(nsXMLDocument,
nsIInterfaceRequestor,
nsIChannelEventSink,
nsIDOMXMLDocument)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(XMLDocument)
NS_INTERFACE_MAP_END_INHERITING(nsDocument)

Просмотреть файл

@ -359,11 +359,13 @@ NS_IMPL_RELEASE_INHERITED(nsXULDocument, nsXMLDocument)
// QueryInterface implementation for nsXULDocument
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXULDocument)
NS_INTERFACE_MAP_ENTRY(nsIXULDocument)
NS_INTERFACE_MAP_ENTRY(nsIDOMXULDocument)
NS_INTERFACE_MAP_ENTRY(nsIStreamLoaderObserver)
NS_INTERFACE_MAP_ENTRY(nsICSSLoaderObserver)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsXULDocument)
NS_INTERFACE_TABLE_INHERITED4(nsXULDocument,
nsIXULDocument,
nsIDOMXULDocument,
nsIStreamLoaderObserver,
nsICSSLoaderObserver)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(XULDocument)
NS_INTERFACE_MAP_END_INHERITING(nsXMLDocument)