From 3082cbf9afd92bcece45b37924d8f5122410fd16 Mon Sep 17 00:00:00 2001 From: "dp%netscape.com" Date: Wed, 16 Jun 1999 00:29:34 +0000 Subject: [PATCH] Using default autoregistration. --- xpcom/proxy/tests/proxytests.cpp | 20 +------------------ xpcom/tests/PropertiesTest.cpp | 31 +++-------------------------- xpcom/tests/TestBuffers.cpp | 5 ----- xpcom/tests/TestFactory.cpp | 3 +-- xpcom/tests/TestObserverService.cpp | 4 ---- xpcom/tests/TestPipes.cpp | 5 ----- 6 files changed, 5 insertions(+), 63 deletions(-) diff --git a/xpcom/proxy/tests/proxytests.cpp b/xpcom/proxy/tests/proxytests.cpp index 7e705d333646..bb69a1ff4f62 100644 --- a/xpcom/proxy/tests/proxytests.cpp +++ b/xpcom/proxy/tests/proxytests.cpp @@ -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 */); } diff --git a/xpcom/tests/PropertiesTest.cpp b/xpcom/tests/PropertiesTest.cpp index 935f83b6cd23..c3d3fef4fb0e 100644 --- a/xpcom/tests/PropertiesTest.cpp +++ b/xpcom/tests/PropertiesTest.cpp @@ -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; diff --git a/xpcom/tests/TestBuffers.cpp b/xpcom/tests/TestBuffers.cpp index 403ec3feb262..6bb900e5d0cd 100644 --- a/xpcom/tests/TestBuffers.cpp +++ b/xpcom/tests/TestBuffers.cpp @@ -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"); diff --git a/xpcom/tests/TestFactory.cpp b/xpcom/tests/TestFactory.cpp index 0e82a9df42a0..18a4ca7cb3ce 100644 --- a/xpcom/tests/TestFactory.cpp +++ b/xpcom/tests/TestFactory.cpp @@ -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(); diff --git a/xpcom/tests/TestObserverService.cpp b/xpcom/tests/TestObserverService.cpp index e5c01263c9bb..07ebfc3ba0ee 100644 --- a/xpcom/tests/TestObserverService.cpp +++ b/xpcom/tests/TestObserverService.cpp @@ -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(), diff --git a/xpcom/tests/TestPipes.cpp b/xpcom/tests/TestPipes.cpp index 36a9c516439b..eb1ddb58a684 100644 --- a/xpcom/tests/TestPipes.cpp +++ b/xpcom/tests/TestPipes.cpp @@ -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