Closed
Bug 131864
Opened 23 years ago
Closed 21 years ago
The way OJI hooking up with Java Plugin is wrong.
Categories
(Core Graveyard :: Java: OJI, defect)
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: xiaobin.lu, Assigned: yuanyi21)
Details
(Whiteboard: close)
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
BuildID: 20020318
Looking at the code below and this is currently how OJI hooks up with Java
Plugin.
-----------------------------------------------
nsIPlugin* pluginFactory = NULL;
// this code is the correct way to obtain pluggable JVM
nsCOMPtr<nsIPlugin> f =
do_GetService(NS_INLINE_PLUGIN_CONTRACTID_PREFIX NS_JVM_MIME_TYPE,
&err);
if (NS_FAILED(err) || !f) {
err = pluginHost->GetPluginFactory(NS_JVM_MIME_TYPE, &pluginFactory);
}
else {
pluginFactory = f;
}
-----------------------------------------
The code below:
nsIPlugin* pluginFactory = NULL;
// this code is the correct way to obtain pluggable JVM
nsCOMPtr<nsIPlugin> f =
do_GetService(NS_INLINE_PLUGIN_CONTRACTID_PREFIX NS_JVM_MIME_TYPE,
&err);
does not make any sense. Basically Mozilla expects a nsIPlugin object, however,
do_GetService will do more than that, it will first get a nsIFactory object and
try to use the IID to get a Plugin object, which is totally wrong. I think we
should either remove that code totally.
Reproducible: Always
Steps to Reproduce:
Comment 1•23 years ago
|
||
First - do_GetService is not legal from your code since, IIRC, the operator()(
const nsIID& aIID, void** aInstancePtr ) of the base class is not inlined
properly. I am trying to provide a solution to this problem with my xpcom
glue library which will allow you to link in a library which will provide you
with this functionality.
In any case, you should double check to ensure that your imports from XPCOM are
only thoses defined nsXPCOM.h. Anything more that that is at your own risk.
As for the plugin specifics, I must defer to Patrick.
Making new so it will show up on (at least) my radar.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 2•23 years ago
|
||
When you say "your code", what do you mean? This call is being made from part
of Mozillia (OJI actually), not the plugin. Are you saying that OJI code should
not be using this call?
Comment 3•23 years ago
|
||
Sorry about that. If OJI is rebuilt with xpcom, then ignore my assertion.
Reporter | ||
Comment 4•23 years ago
|
||
Is there any documentation we can refer to see how nsIModule stuff works? We
want to know after we register the component, how can we can get the service?
Since as Doug mentioned, do_GetService is not valid to use, any idea about how
can we get the nsIFactory object in order to get the real object?
Chris Petersen is a new QA contact for oji component. His email is:
petersen@netscape.com
Assignee: xiaobin.lu → petersen
Comment 6•22 years ago
|
||
fixing small error for pmac@netscape.com (filter with : SPAMMAILSUCKS)
Assignee: petersen → joe.chou
QA Contact: pmac → petersen
AIK, OJI is a module of mozilla, so do_GetService should work.
XiaoBin, I can't understand this bug. Could you please give more detail
information or just provide a patch? Thanks
Assignee | ||
Comment 12•21 years ago
|
||
This bug is no longer valid.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•