From 920c80c057534d3aec2e40ae2ab4ce38ae59f645 Mon Sep 17 00:00:00 2001 From: "michaelp%netscape.com" Date: Sun, 27 Sep 1998 22:14:15 +0000 Subject: [PATCH] now properly handles queries for nsIFactory. --- modules/plugin/base/src/ns4xPlugin.cpp | 8 ++++++++ modules/plugin/nglsrc/ns4xPlugin.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/modules/plugin/base/src/ns4xPlugin.cpp b/modules/plugin/base/src/ns4xPlugin.cpp index a4796141d85a..631bc2eb1229 100644 --- a/modules/plugin/base/src/ns4xPlugin.cpp +++ b/modules/plugin/base/src/ns4xPlugin.cpp @@ -96,6 +96,7 @@ NS_IMPL_RELEASE(ns4xPlugin); static NS_DEFINE_IID(kILiveConnectPluginIID, NS_ILIVECONNECTPLUGIN_IID); static NS_DEFINE_IID(kIPluginIID, NS_IPLUGIN_IID); +static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIWindowlessPluginInstancePeerIID, NS_IWINDOWLESSPLUGININSTANCEPEER_IID); static NS_DEFINE_IID(kISeekablePluginStreamPeerIID, NS_ISEEKABLEPLUGINSTREAMPEER_IID); @@ -125,6 +126,13 @@ ns4xPlugin::QueryInterface(const nsIID& iid, void** instance) return NS_OK; } + if (iid.Equals(kIFactoryIID)) + { + *instance = (void *)(nsIFactory *)this; + AddRef(); + return NS_OK; + } + if (iid.Equals(kISupportsIID)) { *instance = (void *)(nsISupports *)this; diff --git a/modules/plugin/nglsrc/ns4xPlugin.cpp b/modules/plugin/nglsrc/ns4xPlugin.cpp index a4796141d85a..631bc2eb1229 100644 --- a/modules/plugin/nglsrc/ns4xPlugin.cpp +++ b/modules/plugin/nglsrc/ns4xPlugin.cpp @@ -96,6 +96,7 @@ NS_IMPL_RELEASE(ns4xPlugin); static NS_DEFINE_IID(kILiveConnectPluginIID, NS_ILIVECONNECTPLUGIN_IID); static NS_DEFINE_IID(kIPluginIID, NS_IPLUGIN_IID); +static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIWindowlessPluginInstancePeerIID, NS_IWINDOWLESSPLUGININSTANCEPEER_IID); static NS_DEFINE_IID(kISeekablePluginStreamPeerIID, NS_ISEEKABLEPLUGINSTREAMPEER_IID); @@ -125,6 +126,13 @@ ns4xPlugin::QueryInterface(const nsIID& iid, void** instance) return NS_OK; } + if (iid.Equals(kIFactoryIID)) + { + *instance = (void *)(nsIFactory *)this; + AddRef(); + return NS_OK; + } + if (iid.Equals(kISupportsIID)) { *instance = (void *)(nsISupports *)this;