provider = new nsAppFileLocProviderProxy(env, aAppFileLocProvider);
provider = new nsAppFileLocProviderProxy(aAppFileLocProvider);
InitXPCOM_Impl(JNIEnv* env, jobject aMozBinDirectory,               jobject aAppFileLocProvider, jobject* aResult){  nsresult rv;  if (!InitializeJavaGlobals(env))    return NS_ERROR_FAILURE;  // create an nsILocalFile from given java.io.File  nsCOMPtr<nsILocalFile> directory;  if (aMozBinDirectory) {    rv = File_to_nsILocalFile(env, aMozBinDirectory, getter_AddRefs(directory));    NS_ENSURE_SUCCESS(rv, rv);  }  // create nsAppFileLocProviderProxy from given Java object  nsAppFileLocProviderProxy* provider = nsnull;  if (aAppFileLocProvider) {    provider = new nsAppFileLocProviderProxy(env, aAppFileLocProvider);    if (!provider)      return NS_ERROR_OUT_OF_MEMORY;  }  // init XPCOM  nsIServiceManager* servMan = nsnull;  rv = NS_InitXPCOM2(&servMan, directory, provider);  if (provider) {    delete provider;  }  NS_ENSURE_SUCCESS(rv, rv);  // init Event Queue  nsCOMPtr<nsIEventQueueService>             eventQService(do_GetService(NS_EVENTQUEUESERVICE_CONTRACTID, &rv));  NS_ENSURE_SUCCESS(rv, rv);  rv = eventQService->CreateThreadEventQueue();  NS_ENSURE_SUCCESS(rv, rv);  // create Java proxy for service manager returned by NS_InitXPCOM2  rv = CreateJavaProxy(env, servMan, NS_GET_IID(nsIServiceManager),                       aResult);  NS_RELEASE(servMan);   // Java proxy has owning ref  return rv;}