Resolving interface name conflict in plugin sample code, not part of the build
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(d2d536a0-b6fc-11d5-9d10-0060b0fbd8ac)]
|
||||
interface nsIScriptablePlugin : nsISupports {
|
||||
interface nsIScriptablePluginSample : nsISupports {
|
||||
void showVersion();
|
||||
void clear();
|
||||
};
|
||||
@@ -47,7 +47,7 @@
|
||||
//
|
||||
#include "plugin.h"
|
||||
|
||||
static NS_DEFINE_IID(kIScriptableIID, NS_ISCRIPTABLEPLUGIN_IID);
|
||||
static NS_DEFINE_IID(kIScriptableIID, NS_ISCRIPTABLEPLUGINSAMPLE_IID);
|
||||
static NS_DEFINE_IID(kIClassInfoIID, NS_ICLASSINFO_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
@@ -87,7 +87,7 @@ NS_IMETHODIMP nsScriptablePeer::QueryInterface(const nsIID& aIID, void** aInstan
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
if(aIID.Equals(kIScriptableIID)) {
|
||||
*aInstancePtr = static_cast<nsIScriptablePlugin*>(this);
|
||||
*aInstancePtr = static_cast<nsIScriptablePluginSample*>(this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ NS_IMETHODIMP nsScriptablePeer::QueryInterface(const nsIID& aIID, void** aInstan
|
||||
}
|
||||
|
||||
if(aIID.Equals(kISupportsIID)) {
|
||||
*aInstancePtr = static_cast<nsISupports*>(static_cast<nsIScriptablePlugin*>(this));
|
||||
*aInstancePtr = static_cast<nsISupports*>(static_cast<nsIScriptablePluginSample*>(this));
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#ifndef __nsScriptablePeer_h__
|
||||
#define __nsScriptablePeer_h__
|
||||
|
||||
#include "nsIScriptablePlugin.h"
|
||||
#include "nsIScriptablePluginSample.h"
|
||||
#include "nsIClassInfo.h"
|
||||
|
||||
class nsPluginInstance;
|
||||
@@ -78,7 +78,7 @@ class nsClassInfoMixin : public nsIClassInfo
|
||||
{return NS_ERROR_NOT_IMPLEMENTED;}
|
||||
};
|
||||
|
||||
class nsScriptablePeer : public nsIScriptablePlugin,
|
||||
class nsScriptablePeer : public nsIScriptablePluginSample,
|
||||
public nsClassInfoMixin
|
||||
{
|
||||
public:
|
||||
@@ -96,7 +96,7 @@ protected:
|
||||
|
||||
public:
|
||||
// native methods callable from JavaScript
|
||||
NS_DECL_NSISCRIPTABLEPLUGIN
|
||||
NS_DECL_NSISCRIPTABLEPLUGINSAMPLE
|
||||
|
||||
void SetInstance(nsPluginInstance* plugin);
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ NPError nsPluginInstance::GetValue(NPPVariable aVariable, void *aValue)
|
||||
switch (aVariable) {
|
||||
case NPPVpluginScriptableInstance: {
|
||||
// addref happens in getter, so we don't addref here
|
||||
nsIScriptablePlugin * scriptablePeer = getScriptablePeer();
|
||||
nsIScriptablePluginSample * scriptablePeer = getScriptablePeer();
|
||||
if (scriptablePeer) {
|
||||
*(nsISupports **)aValue = scriptablePeer;
|
||||
} else
|
||||
@@ -339,7 +339,7 @@ NPError nsPluginInstance::GetValue(NPPVariable aVariable, void *aValue)
|
||||
break;
|
||||
|
||||
case NPPVpluginScriptableIID: {
|
||||
static nsIID scriptableIID = NS_ISCRIPTABLEPLUGIN_IID;
|
||||
static nsIID scriptableIID = NS_ISCRIPTABLEPLUGINSAMPLE_IID;
|
||||
nsIID* ptr = (nsIID *)NPN_MemAlloc(sizeof(nsIID));
|
||||
if (ptr) {
|
||||
*ptr = scriptableIID;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(d2d536a0-b6fc-11d5-9d10-0060b0fbd8ac)]
|
||||
interface nsIScriptablePlugin : nsISupports {
|
||||
interface nsIScriptablePluginSample : nsISupports {
|
||||
void showVersion();
|
||||
void clear();
|
||||
};
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(d2d536a0-b6fc-11d5-9d10-0060b0fbd8ac)]
|
||||
interface nsIScriptablePlugin : nsISupports {
|
||||
interface nsIScriptablePluginSample : nsISupports {
|
||||
void showVersion();
|
||||
void clear();
|
||||
};
|
||||
@@ -47,7 +47,7 @@
|
||||
//
|
||||
#include "plugin.h"
|
||||
|
||||
static NS_DEFINE_IID(kIScriptableIID, NS_ISCRIPTABLEPLUGIN_IID);
|
||||
static NS_DEFINE_IID(kIScriptableIID, NS_ISCRIPTABLEPLUGINSAMPLE_IID);
|
||||
static NS_DEFINE_IID(kIClassInfoIID, NS_ICLASSINFO_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
@@ -87,7 +87,7 @@ NS_IMETHODIMP nsScriptablePeer::QueryInterface(const nsIID& aIID, void** aInstan
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
if(aIID.Equals(kIScriptableIID)) {
|
||||
*aInstancePtr = static_cast<nsIScriptablePlugin*>(this);
|
||||
*aInstancePtr = static_cast<nsIScriptablePluginSample*>(this);
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ NS_IMETHODIMP nsScriptablePeer::QueryInterface(const nsIID& aIID, void** aInstan
|
||||
}
|
||||
|
||||
if(aIID.Equals(kISupportsIID)) {
|
||||
*aInstancePtr = static_cast<nsISupports*>(static_cast<nsIScriptablePlugin*>(this));
|
||||
*aInstancePtr = static_cast<nsISupports*>(static_cast<nsIScriptablePluginSample*>(this));
|
||||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#ifndef __nsScriptablePeer_h__
|
||||
#define __nsScriptablePeer_h__
|
||||
|
||||
#include "nsIScriptablePlugin.h"
|
||||
#include "nsIScriptablePluginSample.h"
|
||||
#include "nsIClassInfo.h"
|
||||
|
||||
class nsPluginInstance;
|
||||
@@ -78,7 +78,7 @@ class nsClassInfoMixin : public nsIClassInfo
|
||||
{return NS_ERROR_NOT_IMPLEMENTED;}
|
||||
};
|
||||
|
||||
class nsScriptablePeer : public nsIScriptablePlugin,
|
||||
class nsScriptablePeer : public nsIScriptablePluginSample,
|
||||
public nsClassInfoMixin
|
||||
{
|
||||
public:
|
||||
@@ -96,7 +96,7 @@ protected:
|
||||
|
||||
public:
|
||||
// native methods callable from JavaScript
|
||||
NS_DECL_NSISCRIPTABLEPLUGIN
|
||||
NS_DECL_NSISCRIPTABLEPLUGINSAMPLE
|
||||
|
||||
void SetInstance(nsPluginInstance* plugin);
|
||||
|
||||
|
||||
@@ -165,14 +165,14 @@ NPError nsPluginInstance::GetValue(NPPVariable aVariable, void *aValue)
|
||||
|
||||
if (aVariable == NPPVpluginScriptableInstance) {
|
||||
// addref happens in getter, so we don't addref here
|
||||
nsIScriptablePlugin * scriptablePeer = getScriptablePeer();
|
||||
nsIScriptablePluginSample * scriptablePeer = getScriptablePeer();
|
||||
if (scriptablePeer) {
|
||||
*(nsISupports **)aValue = scriptablePeer;
|
||||
} else
|
||||
rv = NPERR_OUT_OF_MEMORY_ERROR;
|
||||
}
|
||||
else if (aVariable == NPPVpluginScriptableIID) {
|
||||
static nsIID scriptableIID = NS_ISCRIPTABLEPLUGIN_IID;
|
||||
static nsIID scriptableIID = NS_ISCRIPTABLEPLUGINSAMPLE_IID;
|
||||
nsIID* ptr = (nsIID *)NPN_MemAlloc(sizeof(nsIID));
|
||||
if (ptr) {
|
||||
*ptr = scriptableIID;
|
||||
|
||||
Reference in New Issue
Block a user