зеркало из https://github.com/mozilla/gecko-dev.git
b=503902; put back npapi DOM object access for WinCE; r=jst
This commit is contained in:
Родитель
b30edd4221
Коммит
2d867ed629
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче