case NPPVjavascriptPushCallerBool: { nsresult rv; nsCOMPtr<nsIJSContextStack> contextStack = do_GetService("@mozilla.org/js/xpc/ContextStack;1", &rv); if (NS_SUCCEEDED(rv)) { NPBool bPushCaller = (result != nsnull); if (bPushCaller) { nsCOMPtr<nsIPluginInstancePeer> peer; rv = inst->GetPeer(getter_AddRefs(peer)); if (NS_SUCCEEDED(rv)) { nsCOMPtr<nsIPluginInstancePeer2> peer2 = do_QueryInterface(peer, &rv); if (NS_SUCCEEDED(rv) && peer2) { JSContext *cx; rv = peer2->GetJSContext(&cx); if (NS_SUCCEEDED(rv)) rv = contextStack->Push(cx); } } } else { rv = contextStack->Pop(nsnull); } } return NS_SUCCEEDED(rv) ? NPERR_NO_ERROR : NPERR_GENERIC_ERROR; } break;
_setvalue(NPP npp, NPPVariable variable, void *result){  NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_SetValue: npp=%p, var=%d\n", (void*)npp, (int)variable));  if(!npp)    return NPERR_INVALID_INSTANCE_ERROR;  ns4xPluginInstance *inst = (ns4xPluginInstance *) npp->ndata;    NS_ASSERTION(inst != NULL, "null instance");  if (inst == NULL)    return NPERR_INVALID_INSTANCE_ERROR;  switch (variable) {    // we should keep backward compatibility with 4x where the    // actual pointer value is checked rather than its content    // wnen passing booleans    case NPPVpluginWindowBool: {      NPBool bWindowless = (result == nsnull);      return inst->SetWindowless(bWindowless);    }    case NPPVpluginTransparentBool: {      NPBool bTransparent = (result != nsnull);      return inst->SetTransparent(bTransparent);    }    default:      return NPERR_NO_ERROR;  }#if 0  nsIPluginInstancePeer *peer;    if (NS_OK == inst->GetPeer(&peer)) {    nsresult rv;        // XXX Note that for backwards compatibility, the old NPPVariables    // map correctly to NPPluginVariables.    rv = peer->SetValue((nsPluginInstancePeerVariable)variable, result);    NS_RELEASE(peer);    return rv;  }  else    return NS_ERROR_UNEXPECTED;#endif}