// GCCallback calls are chained static JSBool ContextCallback(JSContext *cx, uintN operation) { XPCJSRuntime* self = nsXPConnect::GetRuntimeInstance(); if(self) { if(operation == JSCONTEXT_NEW) { if(!self->OnJSContextNew(cx)) return JS_FALSE; } else if(operation == JSCONTEXT_DESTROY) { delete XPCContext::GetXPCContext(cx); } } return JS_TRUE; }