зеркало из https://github.com/mozilla/gecko-dev.git
Change these QueryInterface implementations to be macros, not hand rolled. No bug, r+sr=dveditz
This commit is contained in:
Родитель
9d1e215327
Коммит
efa6824ced
|
@ -77,39 +77,7 @@ nsLoggingSink::~nsLoggingSink() {
|
|||
mOutput=0;
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(nsLoggingSink)
|
||||
NS_IMPL_RELEASE(nsLoggingSink)
|
||||
|
||||
nsresult
|
||||
nsLoggingSink::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtr, "null ptr");
|
||||
if (nsnull == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
nsISupports* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
}
|
||||
else if (aIID.Equals(kIContentSinkIID)) {
|
||||
nsIContentSink* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
}
|
||||
else if (aIID.Equals(kIHTMLContentSinkIID)) {
|
||||
nsIHTMLContentSink* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
}
|
||||
else if (aIID.Equals(kILoggingSinkIID)) {
|
||||
nsILoggingSink* tmp = this;
|
||||
*aInstancePtr = (void*) tmp;
|
||||
}
|
||||
else {
|
||||
*aInstancePtr = nsnull;
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
NS_ADDREF(this);
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMPL_ISUPPORTS3(nsLoggingSink, nsILoggingSink, nsIContentSink, nsIHTMLContentSink)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLoggingSink::SetOutputStream(PRFileDesc *aStream,PRBool autoDeleteOutput) {
|
||||
|
|
|
@ -108,38 +108,7 @@ Stopwatch vsTimer;
|
|||
static const char kBodyId[] = "viewsource";
|
||||
static const char kBodyClassWrap[] = "wrap";
|
||||
|
||||
/**
|
||||
* This method gets called as part of our COM-like interfaces.
|
||||
* Its purpose is to create an interface to parser object
|
||||
* of some type.
|
||||
*
|
||||
* @update gess 4/8/98
|
||||
* @param nsIID id of object to discover
|
||||
* @param aInstancePtr ptr to newly discovered interface
|
||||
* @return NS_xxx result code
|
||||
*/
|
||||
nsresult CViewSourceHTML::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if(aIID.Equals(NS_GET_IID(nsISupports))) { //do IUnknown...
|
||||
*aInstancePtr = (nsIDTD*)(this);
|
||||
}
|
||||
else if(aIID.Equals(NS_GET_IID(nsIDTD))) { //do IParser base class...
|
||||
*aInstancePtr = (nsIDTD*)(this);
|
||||
}
|
||||
else {
|
||||
*aInstancePtr=0;
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF(CViewSourceHTML)
|
||||
NS_IMPL_RELEASE(CViewSourceHTML)
|
||||
NS_IMPL_ISUPPORTS1(CViewSourceHTML, nsIDTD)
|
||||
|
||||
/********************************************
|
||||
********************************************/
|
||||
|
|
Загрузка…
Ссылка в новой задаче