rv = NS_InitEmbedding(directory, provider); if (provider) { delete provider; }
GECKO_NATIVE(initEmbedding) (JNIEnv* env, jclass, jobject aMozBinDirectory,                             jobject aAppFileLocProvider){  nsresult rv = NS_OK;  if (InitializeJavaGlobals(env))  {    // Create an nsILocalFile from given java.io.File    nsCOMPtr<nsILocalFile> directory;    if (aMozBinDirectory) {      rv = File_to_nsILocalFile(env, aMozBinDirectory, getter_AddRefs(directory));    }    if (NS_SUCCEEDED(rv)) {      nsAppFileLocProviderProxy* provider = nsnull;      if (aAppFileLocProvider) {        provider = new nsAppFileLocProviderProxy(env, aAppFileLocProvider);      }      rv = NS_InitEmbedding(directory, provider);      if (provider) {        delete provider;      }      if (NS_SUCCEEDED(rv)) {        return;      }    }  }  ThrowXPCOMException(env, rv, "Failure in initEmbedding");  FreeJavaGlobals(env);}