b=503902; put back npapi DOM object access for WinCE; r=jst

This commit is contained in:
Vladimir Vukicevic 2009-07-16 14:13:43 -07:00
Родитель b30edd4221
Коммит 2d867ed629
1 изменённых файлов: 35 добавлений и 7 удалений

Просмотреть файл

@ -1912,13 +1912,6 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
return NPERR_NO_ERROR;
}
case NPNVserviceManager:
case NPNVDOMElement:
case NPNVDOMWindow: {
// we no longer hand out any XPCOM objects
return NPERR_GENERIC_ERROR;
}
case NPNVToolkit: {
#ifdef MOZ_WIDGET_GTK2
*((NPNToolkitType*)result) = NPNVGtk2;
@ -2000,6 +1993,41 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
}
#endif
// we no longer hand out any XPCOM objects, except on WINCE,
// where it's needed for the ActiveX shunt that makes Flash
// work until we get an NPAPI plugin there.
#ifdef WINCE
case NPNVDOMWindow: {
nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata;
NS_ENSURE_TRUE(inst, NPERR_GENERIC_ERROR);
nsIDOMWindow *domWindow = inst->GetDOMWindow().get();
if (domWindow) {
// Pass over ownership of domWindow to the caller.
(*(nsIDOMWindow**)result) = domWindow;
return NPERR_NO_ERROR;
}
return NPERR_GENERIC_ERROR;
}
case NPNVDOMElement: {
nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *) npp->ndata;
NS_ENSURE_TRUE(inst, NPERR_GENERIC_ERROR);
nsCOMPtr<nsIDOMElement> e;
inst->GetDOMElement(getter_AddRefs(e));
if (e) {
NS_ADDREF(*(nsIDOMElement**)result = e.get());
return NPERR_NO_ERROR;
}
return NPERR_GENERIC_ERROR;
}
#endif /* WINCE */
case NPNVserviceManager: // old XPCOM object, no longer supported
default:
return NPERR_GENERIC_ERROR;
}