NS_IMETHODIMP
HttpBaseChannel::GetContentDisposition(PRUint32 *aContentDisposition)
{
  nsresult rv;
  nsCString header;

  rv = GetContentDispositionHeader(header);
  if (NS_FAILED(rv))
    return rv;

  *aContentDisposition = NS_GetContentDispositionFromHeader(header, this);

  return NS_OK;
}
NS_IMETHODIMP
HttpBaseChannel::GetContentDispositionFilename(nsAString& aContentDispositionFilename)
{
  aContentDispositionFilename.Truncate();

  nsresult rv;
  nsCString header;

  rv = GetContentDispositionHeader(header);
  if (NS_FAILED(rv))
    return rv;

  return NS_GetFilenameFromDisposition(aContentDispositionFilename,
                                       header, mURI);
}
示例#3
0
NS_IMETHODIMP
HttpBaseChannel::GetContentDisposition(uint32_t *aContentDisposition)
{
    nsresult rv;
    nsCString header;

    rv = GetContentDispositionHeader(header);
    if (NS_FAILED(rv)) {
        if (mContentDispositionHint == UINT32_MAX)
            return rv;

        *aContentDisposition = mContentDispositionHint;
        return NS_OK;
    }

    *aContentDisposition = NS_GetContentDispositionFromHeader(header, this);
    return NS_OK;
}