예제 #1
0
void nsPartChannel::SetContentDisposition(const nsACString& aContentDispositionHeader)
{
    mContentDispositionHeader = aContentDispositionHeader;
    nsCOMPtr<nsIURI> uri;
    GetURI(getter_AddRefs(uri));
    NS_GetFilenameFromDisposition(mContentDispositionFilename,
                                  mContentDispositionHeader, uri);
    mContentDisposition = NS_GetContentDispositionFromHeader(mContentDispositionHeader, this);
}
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;
}
예제 #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;
}