use CreatePluginInstance instead of CreateInstance to create plug-ins

VERIFIED FIXED in M14

Status

()

Core
Plug-ins
P3
normal
VERIFIED FIXED
19 years ago
18 years ago

People

(Reporter: Akhil Arora, Assigned: av (gone))

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
Should use the nsIPlugin::CreatePluginInstance to create Plug-ins. Instead,
currently, nsIFactory::CreateInstance is being used. CreatePluginInstance is not
being called at all.

Igor Kushnirskiy <idk@eng.sun.com> already has the trvivial fix (to
nsPluginHostImpl.cpp) that fix this bug. Please review and approve the changes.


Index: nsPluginHostImpl.cpp
===================================================================
RCS file: /cvsroot/mozilla/modules/plugin/nglsrc/nsPluginHostImpl.cpp,v
retrieving revision 1.76
diff -C3 -r1.76 nsPluginHostImpl.cpp
*** nsPluginHostImpl.cpp        1999/09/16 01:15:58     1.76
--- nsPluginHostImpl.cpp        1999/09/17 03:49:37
***************
*** 1863,1868 ****
--- 1863,1872 ----
        result = GetPluginFactory(mimetype, &plugin);
        if(!NS_FAILED(result)){
          result = plugin->CreateInstance(NULL, kIPluginInstanceIID, (void
**)&instance);
+         if (NS_FAILED(result)) {
+           result = plugin->CreatePluginInstance(NULL,
kIPluginInstanceIID,aMimeType, (void **)&instance);
+         }
+
          NS_RELEASE(plugin);
        }
      }
***************

Comment 1

18 years ago
Shrirang is now QA owner for Plug-ins; QA assigning all of my Plug-ins bugs over
to him.
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
Target Milestone: M14
(Assignee)

Comment 2

18 years ago
Igor, would you check this in?
(Reporter)

Comment 3

18 years ago
Perhaps we should reverse the order... call CreatePluginInstance first, since it
is more specific, and if that fails, call the generic CreateInstance.
(Assignee)

Comment 4

18 years ago
Right. I agree.
(Assignee)

Comment 5

18 years ago
Akhil, looks like we can check this in. May I specify you or Igor as code 
reviewer? The proposed change is

        if(!NS_FAILED(result)){
           result = plugin->CreatePluginInstance(NULL,
kIPluginInstanceIID,aMimeType, (void **)&instance);
         if (NS_FAILED(result)) {
          result = plugin->CreateInstance(NULL, kIPluginInstanceIID, (void
**)&instance);
         }
          NS_RELEASE(plugin);
        }
      }

Comment 6

18 years ago
> May I specify Igor as code reviewer 
Sure. I reviwed this fix.
(Assignee)

Comment 7

18 years ago
Cecked in the fix.
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 8

18 years ago
Could someone pls mark this verif since I cannot verify this? thnx !

Comment 9

18 years ago
verif that the fix is in.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.