зеркало из https://github.com/mozilla/pjs.git
Using default autoregistration
This commit is contained in:
Родитель
e2370b2b19
Коммит
49de0b7870
|
@ -113,7 +113,7 @@ main(int argc, char *argv[])
|
|||
nsresult ret;
|
||||
|
||||
ret = nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup,
|
||||
"components");
|
||||
NULL /* default */);
|
||||
if (NS_FAILED(ret)) {
|
||||
printf("auto-registration failed\n");
|
||||
return 1;
|
||||
|
|
|
@ -69,32 +69,7 @@ static NS_DEFINE_IID(kAllocatorCID, NS_ALLOCATOR_CID);
|
|||
|
||||
static void SetupRegistry()
|
||||
{
|
||||
// Autoregistration happens here. The rest of RegisterComponent() calls should happen
|
||||
// only for dlls not in the components directory.
|
||||
|
||||
// Create exeDir/"components"
|
||||
nsSpecialSystemDirectory sysdir(nsSpecialSystemDirectory::OS_CurrentProcessDirectory);
|
||||
sysdir += "components";
|
||||
const char *componentsDir = sysdir.GetCString(); // native path
|
||||
if (componentsDir != NULL)
|
||||
{
|
||||
#ifdef XP_PC
|
||||
/* The PC version of the directory from filePath is of the form
|
||||
* /y|/moz/mozilla/dist/bin/components
|
||||
* We need to remove the initial / and change the | to :
|
||||
* for all this to work with NSPR.
|
||||
*/
|
||||
#endif /* XP_PC */
|
||||
// printf("nsComponentManager: Using components dir: %s\n", componentsDir);
|
||||
|
||||
#ifdef XP_MAC
|
||||
nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, nsnull);
|
||||
#else
|
||||
nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, componentsDir);
|
||||
#endif /* XP_MAC */
|
||||
// XXX Look for user specific components
|
||||
// XXX UNIX: ~/.mozilla/components
|
||||
}
|
||||
nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, nsnull);
|
||||
|
||||
// nsComponentManager::RegisterComponent(kAllocatorCID, NULL, NULL,
|
||||
// XPCOM_DLL, PR_FALSE, PR_FALSE);
|
||||
|
|
|
@ -42,54 +42,9 @@ static NS_DEFINE_CID(kGenericFactoryCID, NS_GENERICFACTORY_CID);
|
|||
static NS_DEFINE_IID(kIAllocatorIID, NS_IALLOCATOR_IID);
|
||||
static NS_DEFINE_IID(kAllocatorCID, NS_ALLOCATOR_CID);
|
||||
|
||||
#ifdef XP_PC
|
||||
#define XPCOM_DLL "xpcom.dll"
|
||||
#else
|
||||
#ifdef XP_MAC
|
||||
#define XPCOM_DLL "XPCOM_DLL"
|
||||
#else
|
||||
#define XPCOM_DLL "libxpcom"MOZ_DLL_SUFFIX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void SetupRegistry()
|
||||
{
|
||||
// Autoregistration happens here. The rest of RegisterComponent() calls should happen
|
||||
// only for dlls not in the components directory.
|
||||
|
||||
// Create exeDir/"components"
|
||||
nsSpecialSystemDirectory sysdir(nsSpecialSystemDirectory::OS_CurrentProcessDirectory);
|
||||
sysdir += "components";
|
||||
const char *componentsDir = sysdir.GetCString(); // native path
|
||||
// const char *componentsDir = nsprPath(sysdir); // native path
|
||||
if (componentsDir != NULL)
|
||||
{
|
||||
#ifdef XP_PC
|
||||
/* The PC version of the directory from filePath is of the form
|
||||
* /y|/moz/mozilla/dist/bin/components
|
||||
* We need to remove the initial / and change the | to :
|
||||
* for all this to work with NSPR.
|
||||
*/
|
||||
#endif /* XP_PC */
|
||||
// printf("nsComponentManager: Using components dir: %s\n", componentsDir);
|
||||
|
||||
#ifdef XP_MAC
|
||||
nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, nsnull);
|
||||
#else
|
||||
nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, componentsDir);
|
||||
#endif /* XP_MAC */
|
||||
// XXX Look for user specific components
|
||||
// XXX UNIX: ~/.mozilla/components
|
||||
}
|
||||
|
||||
// nsComponentManager::RegisterComponent(kAllocatorCID, NULL, NULL,
|
||||
// XPCOM_DLL, PR_FALSE, PR_FALSE);
|
||||
|
||||
nsComponentManager::RegisterComponent(kAllocatorCID, NULL, "allocator",
|
||||
XPCOM_DLL, PR_TRUE, PR_TRUE);
|
||||
|
||||
nsComponentManager::RegisterComponent(kGenericFactoryCID, NULL, NULL,
|
||||
XPCOM_DLL, PR_FALSE, PR_FALSE);
|
||||
nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, nsnull);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -44,32 +44,8 @@ static NS_DEFINE_IID(kFileLocatorCID, NS_FILELOCATOR_CID);
|
|||
extern "C" void
|
||||
NS_SetupRegistry()
|
||||
{
|
||||
// Autoregistration happens here. The rest of RegisterComponent() calls should happen
|
||||
// only for dlls not in the components directory.
|
||||
|
||||
// Create exeDir/"components"
|
||||
nsSpecialSystemDirectory sysdir(nsSpecialSystemDirectory::OS_CurrentProcessDirectory);
|
||||
sysdir += "components";
|
||||
const char *componentsDir = sysdir.GetCString(); // native path
|
||||
if (componentsDir != NULL)
|
||||
{
|
||||
#ifdef XP_PC
|
||||
/* The PC version of the directory from filePath is of the form
|
||||
* /y|/moz/mozilla/dist/bin/components
|
||||
* We need to remove the initial / and change the | to :
|
||||
* for all this to work with NSPR.
|
||||
*/
|
||||
#endif /* XP_PC */
|
||||
printf("nsComponentManager: Using components dir: %s\n", componentsDir);
|
||||
|
||||
#ifdef XP_MAC
|
||||
nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, nsnull);
|
||||
#else
|
||||
nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, componentsDir);
|
||||
#endif /* XP_MAC */
|
||||
// XXX Look for user specific components
|
||||
// XXX UNIX: ~/.mozilla/components
|
||||
}
|
||||
nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup,
|
||||
nsnull /* default */);
|
||||
}
|
||||
/***************************************************************************/
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче