[not part of build] Removed all uses of raw nsIServiceManager, in favor of MRJPlugin::GetService().

This commit is contained in:
beard%netscape.com 2001-10-16 23:27:15 +00:00
Родитель 989673d530
Коммит 899a79e0c1
1 изменённых файлов: 6 добавлений и 9 удалений

Просмотреть файл

@ -43,7 +43,6 @@
#include "LiveConnectNativeMethods.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsIPluginManager.h"
#include "nsIJVMManager.h"
#include "nsILiveconnect.h"
@ -66,7 +65,6 @@
#include "netscape_javascript_JSObject.h" /* javah-generated headers */
extern nsIPluginManager* thePluginManager;
extern nsIServiceManager* theServiceManager; // needs to be in badaptor.cpp.
static MRJPlugin* theJVMPlugin = NULL;
static nsILiveconnect* theLiveConnectManager = NULL;
@ -87,8 +85,7 @@ static NS_DEFINE_IID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
static nsresult getGlobalComponentManager(nsIComponentManager* *result)
{
return theServiceManager->GetService(kComponentManagerCID, NS_GET_IID(nsIComponentManager),
(nsISupports**)result);
return MRJPlugin::GetService(kComponentManagerCID, NS_GET_IID(nsIComponentManager), (void**)result);
}
nsresult InitLiveConnectSupport(MRJPlugin* jvmPlugin)
@ -97,8 +94,8 @@ nsresult InitLiveConnectSupport(MRJPlugin* jvmPlugin)
getGlobalComponentManager(&theComponentManager);
nsresult result = theServiceManager->GetService(kLiveConnectCID, NS_GET_IID(nsILiveconnect),
(nsISupports**)&theLiveConnectManager);
nsresult result = MRJPlugin::GetService(kLiveConnectCID, NS_GET_IID(nsILiveconnect),
(void**)&theLiveConnectManager);
if (result != NS_OK)
return result;
@ -211,7 +208,7 @@ NS_NewURI(nsIURI* *result,
{
nsIIOService* ioService;
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
nsresult rv = theServiceManager->GetService(kIOServiceCID, NS_GET_IID(nsIIOService), (nsISupports**)&ioService);
nsresult rv = MRJPlugin::GetService(kIOServiceCID, NS_GET_IID(nsIIOService), (void**)&ioService);
if (rv == NS_OK)
rv = ioService->NewURI(spec, baseURI, result);
NS_RELEASE(ioService);
@ -354,7 +351,7 @@ void MessageRunnable::execute(JNIEnv* env)
// because a spontaneous Java thread called us, we have to switch to the JavaScript thread
// to handle this request.
nsIThreadManager* threadManager = NULL;
if (theServiceManager->GetService(nsIJVMManager::GetCID(), NS_GET_IID(nsIThreadManager), (nsISupports**)&threadManager) == NS_OK) {
if (MRJPlugin::GetService(nsIJVMManager::GetCID(), NS_GET_IID(nsIThreadManager), (void**)&threadManager) == NS_OK) {
threadManager->PostEvent(mThreadID, this, PR_FALSE);
NS_RELEASE(threadManager);
}
@ -363,7 +360,7 @@ void MessageRunnable::execute(JNIEnv* env)
NS_IMETHODIMP MessageRunnable::Run()
{
nsIJVMManager* javaManager = NULL;
if (theServiceManager->GetService(nsIJVMManager::GetCID(), NS_GET_IID(nsIJVMManager), (nsISupports**)&javaManager) == NS_OK) {
if (MRJPlugin::GetService(nsIJVMManager::GetCID(), NS_GET_IID(nsIJVMManager), (void**)&javaManager) == NS_OK) {
JNIEnv* proxyEnv = NULL;
if (javaManager->GetProxyJNI(&proxyEnv) == NS_OK && proxyEnv != NULL)
mMessage->execute(proxyEnv);