fix changes that busted ipc-test plugin

This commit is contained in:
Chris Jones
2009-09-17 20:49:04 -05:00
parent 0f1302af7c
commit fadfa9346e
4 changed files with 53 additions and 17 deletions

View File

@@ -728,12 +728,14 @@ _utf8fromidentifier(NPIdentifier aIdentifier)
{
_MOZ_LOG(__FUNCTION__);
NPError err;
nsCAutoString val;
nsresult rv = PluginModuleChild::current()->
SendNPN_UTF8FromIdentifier((NPRemoteIdentifier)aIdentifier, &val);
SendNPN_UTF8FromIdentifier((NPRemoteIdentifier)aIdentifier,
&err, &val);
NS_ENSURE_SUCCESS(rv, 0);
return val.IsVoid() ? 0 : strdup(val.get());
return (NPERR_NO_ERROR == err) ? strdup(val.get()) : 0;
}
int32_t NP_CALLBACK
@@ -741,12 +743,15 @@ _intfromidentifier(NPIdentifier aIdentifier)
{
_MOZ_LOG(__FUNCTION__);
NPError err;
int32_t val;
nsresult rv = PluginModuleChild::current()->
SendNPN_IntFromIdentifier((NPRemoteIdentifier)aIdentifier, &val);
SendNPN_IntFromIdentifier((NPRemoteIdentifier)aIdentifier,
&err, &val);
NS_ENSURE_SUCCESS(rv, 0);
return val;
// -1 for consistency
return (NPERR_NO_ERROR == err) ? val : -1;
}
NPObject* NP_CALLBACK
@@ -1019,11 +1024,11 @@ PluginModuleChild::AnswerPPluginInstanceConstructor(PPluginInstanceChild* aActor
argv,
0);
if (NPERR_NO_ERROR != *rv) {
return NS_ERROR_FAILURE;
return false;
}
printf ("[PluginModuleChild] %s: returning %hd\n", __FUNCTION__, *rv);
return true;;
return true;
}
bool