Fix streams to work. Be consistent about AStream* for pdata/ndata. Set up pdata before actually calling the constructor. Implement functions which were stubbed out without TODO comments. This passes the stream tests!

This commit is contained in:
Benjamin Smedberg
2009-09-22 17:06:00 -04:00
parent 4e37ff3dba
commit 441b6d767b
9 changed files with 72 additions and 22 deletions

View File

@@ -192,20 +192,21 @@ PluginModuleParent::NPP_New(NPMIMEType pluginType,
NPError prv = NPERR_GENERIC_ERROR;
nsAutoPtr<PluginInstanceParent> parentInstance(
static_cast<PluginInstanceParent*>(
CallPPluginInstanceConstructor(new PluginInstanceParent(instance,
mNPNIface),
nsDependentCString(pluginType), mode,
names,values, &prv)));
new PluginInstanceParent(instance, mNPNIface));
instance->pdata = parentInstance.get();
if (!CallPPluginInstanceConstructor(parentInstance,
nsDependentCString(pluginType), mode,
names,values, &prv))
return NPERR_GENERIC_ERROR;
printf ("[PluginModuleParent] %s: got return value %hd\n", __FUNCTION__,
prv);
if (NPERR_NO_ERROR != prv)
return prv;
NS_ASSERTION(parentInstance,
"if there's no parentInstance, there should be an error");
if (NPERR_NO_ERROR == prv)
parentInstance.forget();
instance->pdata = (void*) parentInstance.forget();
return prv;
}