Back to index

lightning-sunbird  0.9+nobinonly
nsGenericFactory.cpp File Reference
#include "nsGenericFactory.h"
#include "nsMemory.h"
#include "nsCOMPtr.h"
#include "nsIComponentManager.h"
#include "nsIComponentRegistrar.h"

Go to the source code of this file.


 NS_IMPL_THREADSAFE_ISUPPORTS3 (nsGenericFactory, nsIGenericFactory, nsIFactory, nsIClassInfo) NS_IMETHODIMP nsGenericFactory
NS_COM_GLUE nsresult NS_NewGenericFactory (nsIGenericFactory **result, const nsModuleComponentInfo *info)
NS_COM_GLUE nsresult NS_NewGenericModule2 (nsModuleInfo const *info, nsIModule **result)
 Create a new generic module.
NS_COM_GLUE nsresult NS_NewGenericModule (const char *moduleName, PRUint32 componentCount, nsModuleComponentInfo *components, nsModuleDestructorProc dtor, nsIModule **result)

Function Documentation

Definition at line 70 of file nsGenericFactory.cpp.

    if (mInfo->mConstructor) {
        return mInfo->mConstructor(aOuter, aIID, aResult);


Definition at line 201 of file nsGenericFactory.cpp.

    nsresult rv;
    nsIGenericFactory* fact;
    rv = nsGenericFactory::Create(NULL, NS_GET_IID(nsIGenericFactory), (void**)&fact);
    if (NS_FAILED(rv)) return rv;
    rv = fact->SetComponentInfo(info);
    if (NS_FAILED(rv)) goto error;
    *result = fact;
    return rv;

    return rv;

Here is the call graph for this function:

Here is the caller graph for this function:

NS_COM_GLUE nsresult NS_NewGenericModule ( const char *  moduleName,
PRUint32  componentCount,
nsModuleComponentInfo components,
nsModuleDestructorProc  dtor,
nsIModule **  result 


Use NS_NewGenericModule2() instead.

Definition at line 496 of file nsGenericFactory.cpp.

    nsModuleInfo info;
    memset(&info, 0, sizeof(info));

    info.mVersion    = NS_MODULEINFO_VERSION;
    info.mModuleName = moduleName;
    info.mComponents = components;
    info.mCount      = componentCount;
    info.mDtor       = dtor;

    return NS_NewGenericModule2(&info, result);

Here is the call graph for this function:

Create a new generic module.

Use the NS_IMPL_NSGETMODULE macro, or one of its relatives, rather than using this directly.

Definition at line 478 of file nsGenericFactory.cpp.

    nsresult rv = NS_OK;

    // Create and initialize the module instance
    nsGenericModule *m = 
        new nsGenericModule(info->mModuleName, info->mCount, info->mComponents,
                            info->mCtor, info->mDtor);

    if (!m)
        return NS_ERROR_OUT_OF_MEMORY;

    // Increase refcnt and store away nsIModule interface to m in result
    NS_ADDREF(*result = m);
    return rv;

Here is the call graph for this function:

Here is the caller graph for this function: