PR_ASSERT(initContext->nativeEventThread); nsresult rv; nsCOMPtr<nsIDocumentLoaderObserver> curObserver; nsCOMPtr<DocumentLoaderObserverImpl> myListener = nsnull;
void addDocumentLoadListener(JNIEnv *env, WebShellInitContext *initContext,                             jobject listener){    if (initContext == nsnull) {        ::util_ThrowExceptionToJava(env, "Exception: null initContext passed toaddDocumentLoadListener");        return;    }    if (initContext->initComplete) {        // Assert (nsnull != initContext->nativeEventThread)                // create the c++ "peer" for the DocumentLoadListener, which is an        // nsIDocumentLoaderObserver.        DocumentLoaderObserverImpl *observerImpl =             new DocumentLoaderObserverImpl(env, initContext, listener);                wsAddDocLoaderObserverEvent *actionEvent =             new wsAddDocLoaderObserverEvent(initContext->docShell,                                            observerImpl);                PLEvent			* event       = (PLEvent*) *actionEvent;                ::util_PostEvent(initContext, event);    }}