rv = NS_NewGenericFactory(getter_AddRefs(factory), &nsViewManagerConstructor);
rv = NS_NewGenericFactory(getter_AddRefs(factory), &ViewManagerCI);
nsViewModule::GetClassObject(nsIComponentManager *aCompMgr, const nsCID & aClass,                            const nsIID &aIID, void **aFactory){    nsresult rv = NS_OK;        if (nsnull == aFactory)        return NS_ERROR_NULL_POINTER;    // XXX should we do this ?    *aFactory = nsnull;            if (aClass.Equals(kCViewManager))    {        nsCOMPtr<nsIGenericFactory> factory;        rv = NS_NewGenericFactory(getter_AddRefs(factory), &nsViewManagerConstructor);        if (NS_SUCCEEDED(rv))        {            rv = factory->QueryInterface(aIID, aFactory);        }    }    else if (aClass.Equals(kCView) || aClass.Equals(kCScrollingView) || aClass.Equals(kCScrollPortView))    {        rv = NS_ERROR_OUT_OF_MEMORY;        nsViewFactory* factory = new nsViewFactory(aClass);        if (factory)        {            NS_ADDREF(factory);            rv = factory->QueryInterface(aIID, aFactory);            NS_RELEASE(factory);        }    }	    return rv;}