зеркало из https://github.com/mozilla/pjs.git
- Adding a IID paramter to nsIModule::GetClassObject()
This commit is contained in:
Родитель
8ff4b44481
Коммит
73224d0136
|
@ -139,27 +139,26 @@ nsGIFModule::~nsGIFModule(void)
|
|||
//
|
||||
NS_IMETHODIMP
|
||||
nsGIFModule::GetClassObject(nsIComponentManager *aCompMgr, const nsCID & aClass,
|
||||
nsISupports **r_classObj)
|
||||
const nsIID &aIID, void **r_classObj)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
if( !aClass.Equals(kGIFDecoderCID))
|
||||
return NS_ERROR_FACTORY_NOT_REGISTERED;
|
||||
|
||||
// If this aint the first time, return the cached class object
|
||||
if (mClassObject)
|
||||
if (mClassObject == NULL)
|
||||
{
|
||||
NS_ADDREF(mClassObject);
|
||||
*r_classObj = mClassObject;
|
||||
return NS_OK;
|
||||
nsCOMPtr<nsIGenericFactory> fact;
|
||||
rv = NS_NewGenericFactory(getter_AddRefs(fact), nsGIFDecoderCreateInstance);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Store the class object in our global
|
||||
rv = fact->QueryInterface(NS_GET_IID(nsISupports), (void **)&mClassObject);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIGenericFactory> fact;
|
||||
nsresult rv = NS_NewGenericFactory(getter_AddRefs(fact), nsGIFDecoderCreateInstance);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = fact->QueryInterface(nsIFactory::GetIID(), (void **)&mClassObject);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = fact->QueryInterface(kISupportsIID, (void **)r_classObj);
|
||||
rv = mClassObject->QueryInterface(aIID, r_classObj);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class nsGIFModule : public nsIModule
|
|||
|
||||
// nsIModule Interfaces
|
||||
NS_IMETHOD GetClassObject(nsIComponentManager *aCompMgr, const nsCID & aClass,
|
||||
nsISupports **r_classObj);
|
||||
const nsIID &aIID, void **r_classObj);
|
||||
NS_IMETHOD RegisterSelf(nsIComponentManager *aCompMgr, nsIFileSpec *location);
|
||||
NS_IMETHOD UnregisterSelf(nsIComponentManager *aCompMgr, nsIFileSpec *location);
|
||||
NS_IMETHOD CanUnload(nsIComponentManager *aCompMgr, PRBool *okToUnload);
|
||||
|
|
Загрузка…
Ссылка в новой задаче