зеркало из https://github.com/mozilla/gecko-dev.git
Using default autoregistration.
This commit is contained in:
Родитель
0dc63e6385
Коммит
3082cbf9af
|
@ -38,25 +38,7 @@ static NS_DEFINE_IID(kProxyObjectManagerIID, NS_IPROXYEVENT_MANAGER_IID);
|
|||
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)
|
||||
{
|
||||
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, NULL /* default */);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -62,36 +62,11 @@ static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_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,
|
||||
NULL /* default */);
|
||||
|
||||
// startup netlib:
|
||||
nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE);
|
||||
nsComponentManager::RegisterComponent(kNetServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE);
|
||||
nsComponentManager::RegisterComponent(kNetServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE);
|
||||
|
||||
// Create the Event Queue for this thread...
|
||||
nsIEventQueueService* pEventQService;
|
||||
|
|
|
@ -260,11 +260,6 @@ main()
|
|||
rv = NS_InitXPCOM(&servMgr);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// XXX why do I have to do this?!
|
||||
rv = nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup,
|
||||
"components");
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = TestMallocBuffers(1, 1);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "TestMallocBuffers failed");
|
||||
|
||||
|
|
|
@ -34,9 +34,8 @@ int main(int argc, char **argv) {
|
|||
rv = NS_InitXPCOM(&servMgr);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// XXX why do I have to do this?!
|
||||
rv = nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup,
|
||||
"components");
|
||||
NULL /* default */);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
RegisterTestFactories();
|
||||
|
|
|
@ -74,10 +74,6 @@ int main(int argc, char *argv[])
|
|||
nsString topicB( "topic-B" );
|
||||
nsresult rv;
|
||||
|
||||
rv = nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup,
|
||||
"components");
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsresult res = nsComponentManager::CreateInstance(NS_OBSERVERSERVICE_PROGID,
|
||||
NULL,
|
||||
nsIObserverService::GetIID(),
|
||||
|
|
|
@ -146,11 +146,6 @@ main(int argc, char* argv[])
|
|||
rv = NS_InitXPCOM(&servMgr);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// XXX why do I have to do this?!
|
||||
rv = nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup,
|
||||
"components");
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (argc > 1 && nsCRT::strcmp(argv[1], "-trace") == 0)
|
||||
gTrace = PR_TRUE;
|
||||
#if 0 // obsolete old implementation
|
||||
|
|
Загрузка…
Ссылка в новой задаче