gecko-dev/js/src/xpconnect/loader/mozJSComponentLoader.h

80 lines
2.7 KiB
C
Raw Normal View History

1999-09-07 06:18:08 +00:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "MPL"); you may not use this file except in
* compliance with the MPL. You may obtain a copy of the MPL at
* http://www.mozilla.org/MPL/
*
* Software distributed under the MPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the MPL
* for the specific language governing rights and limitations under the
* MPL.
*
* The Initial Developer of this code under the MPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "plhash.h"
#include "jsapi.h"
1999-09-07 06:18:08 +00:00
#include "nsIComponentLoader.h"
#include "nsIJSRuntimeService.h"
#include "nsIJSContextStack.h"
#include "nsIRegistry.h"
1999-09-07 06:18:08 +00:00
#include "nsISupports.h"
#include "nsIXPConnect.h"
#include "nsIModule.h"
#include "nsSupportsArray.h"
2000-01-24 21:28:28 +00:00
#include "nsIFileSpec.h"
#include "nsIFile.h"
1999-09-07 06:18:08 +00:00
extern const char mozJSComponentLoaderProgID[];
extern const char jsComponentTypeName[];
/* 6bd13476-1dd2-11b2-bbef-f0ccb5fa64b6 (thanks, mozbot) */
#define MOZJSCOMPONENTLOADER_CID \
{0x6bd13476, 0x1dd2, 0x11b2, \
{ 0xbb, 0xef, 0xf0, 0xcc, 0xb5, 0xfa, 0x64, 0xb6 }}
class mozJSComponentLoader : public nsIComponentLoader {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSICOMPONENTLOADER
mozJSComponentLoader();
virtual ~mozJSComponentLoader();
protected:
nsresult ReallyInit();
2000-01-24 21:28:28 +00:00
nsresult AttemptRegistration(nsIFile *component, PRBool deferred);
2000-04-18 05:26:40 +00:00
nsresult UnregisterComponent(nsIFile *component);
2000-01-24 21:28:28 +00:00
nsresult RegisterComponentsInDir(PRInt32 when, nsIFile *dir);
JSObject *GlobalForLocation(const char *aLocation, nsIFile *component);
nsIModule *ModuleForLocation(const char *aLocation,
2000-01-24 21:28:28 +00:00
nsIFile *component);
PRBool HasChanged(const char *registryLocation, nsIFile *component);
nsresult SetRegistryInfo(const char *registryLocation,
2000-01-24 21:28:28 +00:00
nsIFile *component);
2000-04-18 05:26:40 +00:00
nsresult RemoveRegistryInfo(const char *registryLocation);
nsIComponentManager* mCompMgr; // weak ref, should make it strong?
nsCOMPtr<nsIRegistry> mRegistry;
nsCOMPtr<nsIXPConnect> mXPC;
nsCOMPtr<nsIJSRuntimeService> mRuntimeService;
1999-09-07 06:18:08 +00:00
JSObject *mSuperGlobal;
JSRuntime *mRuntime;
JSContext *mContext;
JSObject *mCompMgrWrapper;
JSObject *mSeasonPass; // holds system principal atop the scope chain
1999-09-07 06:18:08 +00:00
PLHashTable *mModules;
PLHashTable *mGlobals;
nsRegistryKey mXPCOMKey;
PRBool mInitialized;
nsSupportsArray mDeferredComponents;
1999-09-07 06:18:08 +00:00
};