nsIModule 编辑
xpcom/components/nsIModule.idl
Scriptable This interface must be implemented by each XPCOM component. It is the main entry point by which the system accesses an XPCOM component. Inherits from: nsISupports
Last changed in Gecko 0.9.9Method overview
boolean canUnload(in nsIComponentManager aCompMgr); |
void getClassObject(in nsIComponentManager aCompMgr, in nsCIDRef aClass, in nsIIDRef aIID, [retval, iid_is(aIID)] out nsQIResult aResult); |
void registerSelf(in nsIComponentManager aCompMgr, in nsIFile aLocation, in string aLoaderStr, in string aType); |
void unregisterSelf(in nsIComponentManager aCompMgr, in nsIFile aLocation, in string aLoaderStr); |
Methods
canUnload()
This method may be queried to determine whether or not the component module can be unloaded by XPCOM.
boolean canUnload( in nsIComponentManager aCompMgr );
Parameters
aCompMgr
- The global component manager.
Return value
Indicates to the caller whether or not the component module can be unloaded. Returning true
is not a guarantee that the module will be unloaded. It constitues only willingness of the module to be unloaded. It is very important to ensure that no outstanding references to the module's code/data exist before returning true
. Returning false
guaratees that the module will not be unloaded.
If the component module is native (that is, as part of a DLL), then this method may be called to determine whether or not the DLL may be unloaded from memory.
Note: As of Gecko 1.7, native component modules are never unloaded.getClassObject()
Obtains a Class Object from a nsIModule
for a given CID and IID pair. This class object can either be query to a nsIFactory
or a may be query to a nsIClassInfo
.
void getClassObject( in nsIComponentManager aCompMgr, in nsCIDRef aClass, in nsIIDRef aIID, [retval, iid_is(aIID)] out nsQIResult aResult );
Parameters
aCompMgr
- The global component manager.
aClass
- The ClassID of object instance requested.
aIID
- The IID of interface requested.
aResult
- The resulting interface pointer.
Exceptions thrown
NS_ERROR_FACTORY_NOT_REGISTERED
- Indicates that the requested class is not available.
NS_ERROR_NO_INTERFACE
- Indicates that the requested interface is not supported.
registerSelf()
When the nsIModule
is discovered, this method will be called so that any setup registration can be preformed.
void registerSelf( in nsIComponentManager aCompMgr, in nsIFile aLocation, in string aLoaderStr, in string aType );
Parameters
aCompMgr
- The global component manager.
aLocation
- The location of the
nsIModule
on disk. aLoaderStr
- Opaque loader specific string.
aType
- Loader Type being used to load this module.
unregisterSelf()
When the nsIModule
is being unregistered, this method will be called so that any unregistration can be preformed.
void unregisterSelf( in nsIComponentManager aCompMgr, in nsIFile aLocation, in string aLoaderStr );
Parameters
aCompMgr
- The global component manager.
aLocation
- The location of the
nsIModule
on disk. aLoaderStr
- Opaque loader specific string.
Remarks
This interface was finalized (frozen) for Gecko 0.9.9. See bug 99154 for details. From Gecko 2.0 interfaces are no longer frozen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论