bug 33099

r=shaver
a=edburns

Native code changes: This fix eradicates all
occurrences of the following symbols
 nsComponentManager nsServiceManeger
And replaces them with their nsI counterparts.
The following ns* classes still are used in
webclient, and no plans exist to replace them
with nsI counterparts: nsresult nsCOMPtr
nsCRT nsnull * nsServiceManager occurrences
were replaced with do_GetService(), using a
PROGID. * nsComponentManager occurrences were replaced with a call on the global class gComponentManager, declared in the new file ns_globals.h, and defined in WrapperFactoryImpl.cpp. ns_globals.h is included in jni_util.h. See the attachment to bug 33099 for ns_globals.h * Added deallocation code to WindowControlImpl.cpp nativeTerminate. I know it doesn't do much, but it's correct. Java code changes: * Added static method BrowserControlFactory.appTerminate(). This method simply calls the existing BrowserControlImpl.appTerminate(), which calls WrapperFactoryImpl.cpp nativeTerminate(). BrowserControlFactory.appTerminate() is called from EmbeddedMozilla's WindowListener, which gets fired when the user signals she wants the app to terminate.


git-svn-id: svn://10.0.0.236/trunk@66563 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
edburns%acm.org
2000-04-20 18:16:05 +00:00
parent fd8819aef9
commit 394bcff4aa
10 changed files with 169 additions and 74 deletions

View File

@@ -23,10 +23,13 @@
#include "RDFTreeNode.h"
#include "rdf_util.h"
#include "rdf_progids.h"
#include "jni_util.h"
#include "nsIServiceManager.h"
#include "prlog.h" // for PR_ASSERT
//
// Local function prototypes
//
@@ -256,11 +259,13 @@ Java_org_mozilla_webclient_wrapper_1native_RDFTreeNode_nativeInsertElementAt
return;
}
PR_ASSERT(gComponentManager);
// get a container in order to create a child
rv = nsComponentManager::CreateInstance(NS_IRDFCONTAINER_PROGID,
nsnull,
NS_GET_IID(nsIRDFContainer),
getter_AddRefs(container));
rv = gComponentManager->CreateInstanceByProgID(NS_RDFCONTAINER_PROGID,
nsnull,
NS_GET_IID(nsIRDFContainer),
getter_AddRefs(container));
if (NS_FAILED(rv)) {
::util_ThrowExceptionToJava(env, "Exception: nativeNewRDFNode: can't create container.");
return;