зеркало из https://github.com/mozilla/pjs.git
add ipcModuleMethods::init
This commit is contained in:
Родитель
2154715aa0
Коммит
633870cbb6
|
@ -148,6 +148,10 @@ struct ipcCommandModule
|
|||
// ipcModule interface impl
|
||||
//
|
||||
|
||||
static void Init()
|
||||
{
|
||||
}
|
||||
|
||||
static void Shutdown()
|
||||
{
|
||||
}
|
||||
|
@ -187,6 +191,7 @@ ipcModuleMethods *IPC_GetCommandModuleMethods()
|
|||
static ipcModuleMethods methods =
|
||||
{
|
||||
IPC_MODULE_METHODS_VERSION,
|
||||
ipcCommandModule::Init,
|
||||
ipcCommandModule::Shutdown,
|
||||
ipcCommandModule::HandleMsg
|
||||
};
|
||||
|
|
|
@ -72,6 +72,11 @@ struct ipcModuleMethods
|
|||
//
|
||||
PRUint32 version;
|
||||
|
||||
//
|
||||
// called after this module is registered.
|
||||
//
|
||||
void (* init) (void);
|
||||
|
||||
//
|
||||
// called when this module will no longer be accessed.
|
||||
//
|
||||
|
|
|
@ -117,8 +117,11 @@ InitModuleFromLib(const char *modulesDir, const char *fileName)
|
|||
if (func) {
|
||||
ipcModuleEntry *entries = NULL;
|
||||
int count = func(&gDaemonMethods, &entries);
|
||||
for (int i=0; i<count; ++i)
|
||||
for (int i=0; i<count; ++i) {
|
||||
AddModule(entries[i].target, entries[i].methods, PR_LoadLibrary(buf));
|
||||
if (entries[i].methods->init)
|
||||
entries[i].methods->init();
|
||||
}
|
||||
}
|
||||
PR_UnloadLibrary(lib);
|
||||
}
|
||||
|
|
|
@ -12,6 +12,11 @@ static const nsID TestModuleID =
|
|||
|
||||
struct TestModule
|
||||
{
|
||||
static void Init()
|
||||
{
|
||||
printf("*** TestModule::Init\n");
|
||||
}
|
||||
|
||||
static void Shutdown()
|
||||
{
|
||||
printf("*** TestModule::Shutdown\n");
|
||||
|
@ -30,6 +35,7 @@ struct TestModule
|
|||
static ipcModuleMethods gTestMethods =
|
||||
{
|
||||
IPC_MODULE_METHODS_VERSION,
|
||||
TestModule::Init,
|
||||
TestModule::Shutdown,
|
||||
TestModule::HandleMsg
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче