NOT PART OF BUILD. Fix bustage running in 1.0.x builds and the use of nsAutoString in LegacyPlugin.cpp because of xpcom glue issues
git-svn-id: svn://10.0.0.236/trunk@132099 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
773e03ecda
commit
8db57b5393
@ -166,7 +166,7 @@ NPError NewControl(const char *pluginType,
|
||||
{
|
||||
// Read the parameters
|
||||
CLSID clsid = CLSID_NULL;
|
||||
nsCAutoString codebase;
|
||||
CComBSTR codebase;
|
||||
PropertyList pl;
|
||||
|
||||
if (strcmp(pluginType, MIME_OLEOBJECT1) != 0 &&
|
||||
@ -211,17 +211,14 @@ NPError NewControl(const char *pluginType,
|
||||
}
|
||||
else if (stricmp(argn[i], "CODEBASE") == 0)
|
||||
{
|
||||
codebase.Assign(argv[i]);
|
||||
codebase = argv[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
USES_CONVERSION;
|
||||
|
||||
nsAutoString paramName;
|
||||
|
||||
CComBSTR paramName;
|
||||
if (strnicmp(argn[i], "PARAM_", 6) == 0)
|
||||
{
|
||||
paramName.AssignWithConversion(argn[i]+6);
|
||||
paramName = argn[i] + 6;
|
||||
}
|
||||
else if (stricmp(argn[i], "PARAM") == 0)
|
||||
{
|
||||
@ -231,11 +228,11 @@ NPError NewControl(const char *pluginType,
|
||||
}
|
||||
else
|
||||
{
|
||||
paramName.AssignWithConversion(argn[i]);
|
||||
paramName = argn[i];
|
||||
}
|
||||
|
||||
// Empty parameters are ignored
|
||||
if (paramName.IsEmpty())
|
||||
if (!paramName.m_str || paramName.Length() == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -244,9 +241,9 @@ NPError NewControl(const char *pluginType,
|
||||
|
||||
// Check for existing params with the same name
|
||||
BOOL bFound = FALSE;
|
||||
for (PropertyList::const_iterator i = pl.begin(); i != pl.end(); i++)
|
||||
for (PropertyList::const_iterator it = pl.begin(); it != pl.end(); it++)
|
||||
{
|
||||
if (wcscmp((BSTR) (*i).szName, paramName.get()) == 0)
|
||||
if (wcscmp((BSTR) (*it).szName, (BSTR) paramName) == 0)
|
||||
{
|
||||
bFound = TRUE;
|
||||
break;
|
||||
@ -282,7 +279,7 @@ NPError NewControl(const char *pluginType,
|
||||
|
||||
// Add named parameter to list
|
||||
Property p;
|
||||
p.szName = paramName.get();
|
||||
p.szName = paramName;
|
||||
p.vValue = vValue;
|
||||
pl.push_back(p);
|
||||
}
|
||||
@ -384,6 +381,9 @@ NPError NP_LOADDS NPP_New(NPMIMEType pluginType,
|
||||
#endif
|
||||
|
||||
// Create a plugin according to the mime type
|
||||
#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
|
||||
xpc_AddRef();
|
||||
#endif
|
||||
|
||||
NPError rv = NPERR_GENERIC_ERROR;
|
||||
if (strcmp(pluginType, MIME_ACTIVESCRIPT) == 0)
|
||||
@ -404,6 +404,9 @@ NPError NP_LOADDS NPP_New(NPMIMEType pluginType,
|
||||
if (pData->szUrl)
|
||||
free(pData->szUrl);
|
||||
delete pData;
|
||||
#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
|
||||
xpc_Release();
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -459,6 +462,9 @@ NPP_Destroy(NPP instance, NPSavedData** save)
|
||||
if (pData->szContentType)
|
||||
free(pData->szContentType);
|
||||
delete pData;
|
||||
#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
|
||||
xpc_Release();
|
||||
#endif
|
||||
|
||||
instance->pdata = 0;
|
||||
|
||||
|
||||
@ -337,6 +337,7 @@ nsScriptablePeer::ConvertVariants(nsIVariant *aIn, VARIANT *aOut)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT
|
||||
nsScriptablePeer::ConvertVariants(VARIANT *aIn, nsIVariant **aOut)
|
||||
{
|
||||
@ -349,6 +350,35 @@ nsScriptablePeer::ConvertVariants(VARIANT *aIn, nsIVariant **aOut)
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIWritableVariant> v = do_CreateInstance("@mozilla.org/variant;1", &rv);
|
||||
|
||||
// NOTE: THIS IS AN UGLY BACKWARDS COMPATIBILITY HACK TO WORKAROUND
|
||||
// XPCOM GLUE'S INABILITY TO FIND A CERTAIN ENTRY POINT IN MOZ1.0.x/NS7.0!
|
||||
// DO NOT TAUNT THE HACK
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
// do_CreateInstance macro is broken so load the component manager by
|
||||
// hand and get it to create the component.
|
||||
HMODULE hlib = ::LoadLibrary("xpcom.dll");
|
||||
if (hlib)
|
||||
{
|
||||
nsIComponentManager *pManager = nsnull; // A frozen interface, even in 1.0.x
|
||||
typedef nsresult (PR_CALLBACK *Moz1XGetComponentManagerFunc)(nsIComponentManager* *result);
|
||||
Moz1XGetComponentManagerFunc compMgr = (Moz1XGetComponentManagerFunc)
|
||||
::GetProcAddress(hlib, "NS_GetComponentManager");
|
||||
if (compMgr)
|
||||
{
|
||||
compMgr(&pManager);
|
||||
if (pManager)
|
||||
{
|
||||
rv = pManager->CreateInstanceByContractID("@mozilla.org/variant;1",
|
||||
nsnull, NS_GET_IID(nsIWritableVariant), (void **) &v);
|
||||
pManager->Release();
|
||||
}
|
||||
}
|
||||
::FreeLibrary(hlib);
|
||||
}
|
||||
}
|
||||
// END HACK
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
switch (aIn->vt)
|
||||
@ -524,7 +554,6 @@ nsScriptablePeer::GetProperty(const char *propertyName, nsIVariant **_retval)
|
||||
return NPERR_GENERIC_ERROR;
|
||||
}
|
||||
|
||||
DISPID dispIdPut = DISPID_PROPERTYPUT;
|
||||
_variant_t vResult;
|
||||
|
||||
DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
|
||||
@ -720,7 +749,6 @@ nsEventSink::InternalInvoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wF
|
||||
nsAutoString eventName(bstrName.m_str);
|
||||
|
||||
// TODO Turn VARIANT args into js objects
|
||||
|
||||
// Fire event to DOM 2 event listeners
|
||||
|
||||
nsCOMPtr<nsIDOMEventReceiver> eventReceiver = do_QueryInterface(element);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user