InitEmbedding_Impl(JNIEnv* env, jobject aMozBinDirectory, jobject aAppFileLocProvider)
InitEmbedding_Impl(JNIEnv* env, jobject aLibXULDirectory, jobject aAppDirectory, jobject aAppDirProvider)
InitEmbedding_Impl(JNIEnv* env, jobject aMozBinDirectory,                   jobject aAppFileLocProvider){  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  nsCOMPtr<nsIDirectoryServiceProvider> provider;  if (aAppFileLocProvider) {    rv = NS_NewAppFileLocProviderProxy(aAppFileLocProvider,                                       getter_AddRefs(provider));    NS_ENSURE_SUCCESS(rv, rv);  }  // init Gecko  rv = NS_InitEmbedding(directory, 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();  return rv;}