Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
mozJSLoaderConstructors.h File Reference
#include "nsIGenericFactory.h"
#include "nsICategoryManager.h"
#include "mozJSComponentLoader.h"
#include "mozJSSubScriptLoader.h"

Go to the source code of this file.

Functions

static NS_METHOD RegisterJSLoader (nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation, const char *componentType, const nsModuleComponentInfo *info)
static NS_METHOD UnregisterJSLoader (nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation, const nsModuleComponentInfo *info)

Variables

const char mozJSSubScriptLoadContractID [] = "@mozilla.org/moz/jssubscript-loader;1"

Function Documentation

static NS_METHOD RegisterJSLoader ( nsIComponentManager aCompMgr,
nsIFile aPath,
const char *  registryLocation,
const char *  componentType,
const nsModuleComponentInfo info 
) [static]

Definition at line 58 of file mozJSLoaderConstructors.h.

Here is the call graph for this function:

static NS_METHOD UnregisterJSLoader ( nsIComponentManager aCompMgr,
nsIFile aPath,
const char *  registryLocation,
const nsModuleComponentInfo info 
) [static]

Definition at line 74 of file mozJSLoaderConstructors.h.

{
    nsresult rv;
    nsCOMPtr<nsICategoryManager> catman =
        do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
    if (NS_FAILED(rv)) return rv;
    nsXPIDLCString jsLoader;
    rv = catman->GetCategoryEntry("component-loader",
                                  MOZJSCOMPONENTLOADER_TYPE_NAME,
                                  getter_Copies(jsLoader));
    if (NS_FAILED(rv)) return rv;

    // only unregister if we're the current JS component loader
    if (!strcmp(jsLoader, MOZJSCOMPONENTLOADER_CONTRACTID)) {
        return catman->DeleteCategoryEntry("component-loader",
                                           MOZJSCOMPONENTLOADER_TYPE_NAME,
                                           PR_TRUE);
    }
    return NS_OK;
}

Here is the call graph for this function:


Variable Documentation

const char mozJSSubScriptLoadContractID[] = "@mozilla.org/moz/jssubscript-loader;1"

Definition at line 54 of file mozJSLoaderConstructors.h.