Closed Bug 33099 Opened 24 years ago Closed 24 years ago

XPCOM Correctness: webclient depends on ns* classes rather than nsI interfaces.

Categories

(Core Graveyard :: Java APIs to WebShell, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: edburns, Assigned: edburns)

References

Details

Attachments

(2 files)

Currently, we link with xpcom.lib, and we use non nsI interfaces. 
        This has to change so we only link with xpcom.dll.
Here's a summary of the non nsI symbols on which webclient depends:

CurrentPageImpl.cpp:        nsCRT::free(charResult);
DocumentLoaderObserverImpl.cpp:			     nsString& aMsg) 
HistoryImpl.cpp:      nsCRT::free(charResult);
NativeEventThread.cpp:    rv = nsServiceManager::GetService
(kEventQueueServiceCID,
RDFEnumeration.cpp:    rv = nsComponentManager::CreateInstance
(NS_IRDFCONTAINER_PROGID,
WrapperFactoryImpl.cpp:static nsFileSpec gBinDir; 


Thankfully there aren't that many.
Status: NEW → ASSIGNED
Depends on: 28660
Attached file New file
Here is some descriptive text for the above attachments:

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.

* Moved call to BrowserControlFactory.setAppData() from per-window
  EMWindow contructor to per-app EmbeddedMozilla.  This is more correct.
Blocks: 34274
Changed Summary.
Summary: webclient depends on ns* classes rather than nsI interfaces. → XPCOM Correctness: webclient depends on ns* classes rather than nsI interfaces.
- Should purge the rest of the static kInterfaceIID stuff, in favour of
NS_GET_IID.
- do you really want a copy of the PROGIDs in every file that includes
rdf_utils.h?  Why not declare them extern there and define them in one .cpp
file?

Other than that, it looks pretty good. r=shaver.
Thanks Mike,

The real solution on the RDF PROGIDs is fixing 
http://bugzilla.mozilla.org/show_bug.cgi?id=33192

Ed
Shaver reviewed.  Checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: