nsPermissionEnumerator::GetNext(nsISupports **aResult) { if (mHostIndex >= mHostCount) { *aResult = nsnull; return NS_ERROR_FAILURE; }
NS_IMETHOD GetNext(nsISupports **aResult) { *aResult = mNextPermission; if (!mNextPermission) return NS_ERROR_FAILURE;
nsPermissionEnumerator::GetNext(nsISupports **aResult) {  if (mHostIndex >= mHostCount) {    *aResult = nsnull;    return NS_ERROR_FAILURE;  }  permission_HostStruct *hostStruct = NS_STATIC_CAST(permission_HostStruct*, mPermissionList.ElementAt(mHostIndex));  NS_ASSERTION(hostStruct, "corrupt permission list");  permission_TypeStruct *typeStruct = NS_STATIC_CAST(permission_TypeStruct*, hostStruct->permissionList.ElementAt(mTypeIndex++));  if (mTypeIndex == hostStruct->permissionList.Count()) {    mTypeIndex = 0;    mHostIndex++;  }  nsIPermission *permission =      new nsPermission(hostStruct->host, typeStruct->type, typeStruct->permission);  if (!permission) {    *aResult = nsnull;    return NS_ERROR_OUT_OF_MEMORY;  }  *aResult = permission;  NS_ADDREF(permission);  return NS_OK;}