Bug 522796 - Implement NPN_SetException for remote plugins, r=bsmedberg

This commit is contained in:
malek@lcde.net 2011-07-26 12:55:58 -04:00
parent 885af129ba
commit 26eb897786
5 changed files with 40 additions and 2 deletions

View File

@ -39,6 +39,7 @@
include protocol PPluginIdentifier;
include protocol PPluginInstance;
include protocol PPluginScriptableObject;
include "npapi.h";
include "mozilla/plugins/PluginMessageUtils.h";
@ -153,6 +154,9 @@ parent:
async PushCursor(NSCursorInfo cursorInfo);
async PopCursor();
sync GetNativeCursorsSupported() returns (bool supported);
sync NPN_SetException(nullable PPluginScriptableObject actor,
nsCString message);
};
} // namespace plugins

View File

@ -1516,7 +1516,19 @@ _setexception(NPObject* aNPObj,
{
PLUGIN_LOG_DEBUG_FUNCTION;
ENSURE_PLUGIN_THREAD_VOID();
NS_WARNING("Not yet implemented!");
PluginModuleChild* self = PluginModuleChild::current();
PluginScriptableObjectChild* actor = NULL;
if (aNPObj) {
actor = self->GetActorForNPObject(aNPObj);
if (!actor) {
NS_ERROR("Failed to get actor!");
return;
}
}
self->SendNPN_SetException(static_cast<PPluginScriptableObjectChild*>(actor),
NullableString(aMessage));
}
void NP_CALLBACK

View File

@ -1209,3 +1209,21 @@ PluginModuleParent::RemoveFromRefreshTimer(PluginInstanceParent *aInstance) {
}
}
#endif
bool
PluginModuleParent::RecvNPN_SetException(PPluginScriptableObjectParent* aActor,
const nsCString& aMessage)
{
PLUGIN_LOG_DEBUG(("%s", FULLFUNCTION));
NPObject* aNPObj = NULL;
if (aActor) {
aNPObj = static_cast<PluginScriptableObjectParent*>(aActor)->GetObject(true);
if (!aNPObj) {
NS_ERROR("Failed to get object!");
return false;
}
}
mozilla::plugins::parent::_setexception(aNPObj, NullableStringGet(aMessage));
return true;
}

View File

@ -210,6 +210,10 @@ protected:
NS_OVERRIDE virtual bool
RecvGetNativeCursorsSupported(bool* supported);
NS_OVERRIDE virtual bool
RecvNPN_SetException(PPluginScriptableObjectParent* aActor,
const nsCString& aMessage);
static PluginInstanceParent* InstCast(NPP instance);
static BrowserStreamParent* StreamCast(NPP instance, NPStream* s);

View File

@ -102,10 +102,10 @@ _MOCHITEST_FILES = \
test_clear_site_data.html \
test_zero_opacity.html \
test_NPPVpluginWantsAllNetworkStreams.html \
test_npruntime_npnsetexception.html \
$(NULL)
# test_plugin_scroll_painting.html \ bug 596491
# test_npruntime_npnsetexception.html \ Disabled for e10s
ifeq ($(OS_ARCH),WINNT)
_MOCHITEST_FILES += \