JVMContext* context = GetJVMContext(); JVMSecurityStack  *securityStack = context->securityStack; JVMSecurityStack  *securityStackTop = NULL; JSContext         *cx = context->js_context;  if(securityStack != NULL) { securityStackTop = securityStack->prev; JSStackFrame *fp = NULL; securityStackTop->pJSToJavaFrame = JS_FrameIterator(cx, &fp); }
JSContext *cx = nsnull; nsCOMPtr<nsIJSContextStack> stack = do_GetService("@mozilla.org/js/xpc/ContextStack;1"); if (stack) stack->Peek(&cx);
JVM_GetJSSecurityContext(){    JVMContext* context = GetJVMContext();    JVMSecurityStack  *securityStack = context->securityStack;     JVMSecurityStack  *securityStackTop = NULL;    JSContext         *cx = context->js_context;    if(securityStack != NULL) {	securityStackTop = securityStack->prev; 	JSStackFrame *fp = NULL;	securityStackTop->pJSToJavaFrame = JS_FrameIterator(cx, &fp);    }    nsCSecurityContext *securityContext = new nsCSecurityContext(cx);    if (securityContext == nsnull) {        return nsnull;    }    NS_ADDREF(securityContext);    return securityContext;}