mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 385154 - remove nsInt64 usage from the tree. r=roc
This commit is contained in:
parent
fb2eda49cf
commit
7d36965d96
@ -509,8 +509,8 @@ nsWyciwygChannel::OnDataAvailable(nsIRequest *request, nsISupports *ctx,
|
||||
|
||||
// XXX handle 64-bit stuff for real
|
||||
if (mProgressSink && NS_SUCCEEDED(rv) && !(mLoadFlags & LOAD_BACKGROUND))
|
||||
mProgressSink->OnProgress(this, nsnull, nsUint64(offset + count),
|
||||
nsUint64(mContentLength));
|
||||
mProgressSink->OnProgress(this, nsnull, PRUint64(offset + count),
|
||||
PRUint64(mContentLength));
|
||||
|
||||
return rv; // let the pump cancel on failure
|
||||
}
|
||||
|
@ -986,8 +986,8 @@ NS_IMETHODIMP nsWebBrowserPersist::OnProgress(
|
||||
else
|
||||
{
|
||||
// have to truncate 64-bit to 32bit
|
||||
mProgressListener->OnProgressChange(nsnull, request, nsUint64(aProgress),
|
||||
nsUint64(aProgressMax), mTotalCurrentProgress, mTotalMaxProgress);
|
||||
mProgressListener->OnProgressChange(nsnull, request, PRUint64(aProgress),
|
||||
PRUint64(aProgressMax), mTotalCurrentProgress, mTotalMaxProgress);
|
||||
}
|
||||
|
||||
// If our progress listener implements nsIProgressEventSink,
|
||||
|
@ -559,8 +559,8 @@ GeckoProtocolChannel::OnDataAvailable(nsIRequest *req, nsISupports *ctx,
|
||||
|
||||
// XXX can this use real 64-bit ints?
|
||||
if (mProgressSink && NS_SUCCEEDED(rv) && !(mLoadFlags & LOAD_BACKGROUND))
|
||||
mProgressSink->OnProgress(this, nsnull, nsUint64(offset + count),
|
||||
nsUint64(mContentLength));
|
||||
mProgressSink->OnProgress(this, nsnull, PRUint64(offset + count),
|
||||
PRUint64(mContentLength));
|
||||
|
||||
return rv; // let the pump cancel on failure
|
||||
}
|
||||
|
@ -913,8 +913,8 @@ nsJARChannel::OnDataAvailable(nsIRequest *req, nsISupports *ctx,
|
||||
// nsITransportEventSink implementation.
|
||||
// XXX do the 64-bit stuff for real
|
||||
if (mProgressSink && NS_SUCCEEDED(rv) && !(mLoadFlags & LOAD_BACKGROUND))
|
||||
mProgressSink->OnProgress(this, nsnull, nsUint64(offset + count),
|
||||
nsUint64(mContentLength));
|
||||
mProgressSink->OnProgress(this, nsnull, PRUint64(offset + count),
|
||||
PRUint64(mContentLength));
|
||||
|
||||
return rv; // let the pump cancel on failure
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ private:
|
||||
nsresult mCondition;
|
||||
nsCOMPtr<nsIInputStreamCallback> mCallback;
|
||||
PRUint32 mCallbackFlags;
|
||||
nsUint64 mByteCount;
|
||||
PRUint64 mByteCount;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -124,7 +124,7 @@ private:
|
||||
nsresult mCondition;
|
||||
nsCOMPtr<nsIOutputStreamCallback> mCallback;
|
||||
PRUint32 mCallbackFlags;
|
||||
nsUint64 mByteCount;
|
||||
PRUint64 mByteCount;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -94,8 +94,8 @@ private:
|
||||
// nsIInputStream implementation.
|
||||
nsCOMPtr<nsITransportEventSink> mEventSink;
|
||||
nsCOMPtr<nsIInputStream> mSource;
|
||||
nsUint64 mOffset;
|
||||
nsUint64 mLimit;
|
||||
PRUint64 mOffset;
|
||||
PRUint64 mLimit;
|
||||
PRPackedBool mCloseWhenDone;
|
||||
PRPackedBool mFirstTime;
|
||||
|
||||
@ -208,14 +208,12 @@ nsInputStreamTransport::Read(char *buf, PRUint32 count, PRUint32 *result)
|
||||
{
|
||||
if (mFirstTime) {
|
||||
mFirstTime = PR_FALSE;
|
||||
if (mOffset != nsUint64(0)) {
|
||||
if (mOffset != 0) {
|
||||
// read from current position if offset equal to max
|
||||
if (mOffset != LL_MAXUINT) {
|
||||
nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mSource);
|
||||
// Note: The casts to PRUint64 are needed to cast to PRInt64, as
|
||||
// nsUint64 can't directly be cast to PRInt64
|
||||
if (seekable)
|
||||
seekable->Seek(nsISeekableStream::NS_SEEK_SET, PRUint64(mOffset));
|
||||
seekable->Seek(nsISeekableStream::NS_SEEK_SET, mOffset);
|
||||
}
|
||||
// reset offset to zero so we can use it to enforce limit
|
||||
mOffset = 0;
|
||||
@ -296,8 +294,8 @@ private:
|
||||
// nsIOutputStream implementation.
|
||||
nsCOMPtr<nsITransportEventSink> mEventSink;
|
||||
nsCOMPtr<nsIOutputStream> mSink;
|
||||
nsUint64 mOffset;
|
||||
nsUint64 mLimit;
|
||||
PRUint64 mOffset;
|
||||
PRUint64 mLimit;
|
||||
PRPackedBool mCloseWhenDone;
|
||||
PRPackedBool mFirstTime;
|
||||
|
||||
@ -410,14 +408,12 @@ nsOutputStreamTransport::Write(const char *buf, PRUint32 count, PRUint32 *result
|
||||
{
|
||||
if (mFirstTime) {
|
||||
mFirstTime = PR_FALSE;
|
||||
if (mOffset != nsUint64(0)) {
|
||||
if (mOffset != 0) {
|
||||
// write to current position if offset equal to max
|
||||
if (mOffset != LL_MAXUINT) {
|
||||
nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mSink);
|
||||
// Note: The casts to PRUint64 are needed to cast to PRInt64, as
|
||||
// nsUint64 can't directly be cast to PRInt64
|
||||
if (seekable)
|
||||
seekable->Seek(nsISeekableStream::NS_SEEK_SET, PRUint64(mOffset));
|
||||
seekable->Seek(nsISeekableStream::NS_SEEK_SET, mOffset);
|
||||
}
|
||||
// reset offset to zero so we can use it to enforce limit
|
||||
mOffset = 0;
|
||||
|
@ -5264,8 +5264,8 @@ nsHttpChannel::OnDataAvailable(nsIRequest *request, nsISupports *ctxt,
|
||||
// of a byte range request, the content length stored in the cached
|
||||
// response headers is what we want to use here.
|
||||
|
||||
nsUint64 progressMax(PRUint64(mResponseHead->ContentLength()));
|
||||
nsUint64 progress = mLogicalOffset + nsUint64(count);
|
||||
PRUint64 progressMax(PRUint64(mResponseHead->ContentLength()));
|
||||
PRUint64 progress = mLogicalOffset + PRUint64(count);
|
||||
NS_ASSERTION(progress <= progressMax, "unexpected progress values");
|
||||
|
||||
OnTransportStatus(nsnull, transportStatus, progress, progressMax);
|
||||
|
@ -285,7 +285,7 @@ private:
|
||||
|
||||
PRUint32 mLoadFlags;
|
||||
PRUint32 mStatus;
|
||||
nsUint64 mLogicalOffset;
|
||||
PRUint64 mLogicalOffset;
|
||||
PRUint8 mCaps;
|
||||
PRInt16 mPriority;
|
||||
|
||||
|
@ -378,7 +378,7 @@ nsHttpTransaction::OnTransportStatus(nsresult status, PRUint64 progress)
|
||||
if (status == nsISocketTransport::STATUS_RECEIVING_FROM)
|
||||
return;
|
||||
|
||||
nsUint64 progressMax;
|
||||
PRUint64 progressMax;
|
||||
|
||||
if (status == nsISocketTransport::STATUS_SENDING_TO) {
|
||||
// suppress progress when only writing request headers
|
||||
|
@ -814,7 +814,7 @@ nsMultiMixedConv::SendData(char *aBuffer, PRUint32 aLen) {
|
||||
if (mContentLength != LL_MAXUINT) {
|
||||
// make sure that we don't send more than the mContentLength
|
||||
// XXX why? perhaps the Content-Length header was actually wrong!!
|
||||
if ((nsUint64(aLen) + mTotalSent) > mContentLength)
|
||||
if ((PRUint64(aLen) + mTotalSent) > mContentLength)
|
||||
aLen = mContentLength - mTotalSent;
|
||||
|
||||
if (aLen == 0)
|
||||
|
@ -93,7 +93,7 @@ protected:
|
||||
nsCString mContentType;
|
||||
nsCString mContentCharset;
|
||||
nsCString mContentDisposition;
|
||||
nsUint64 mContentLength;
|
||||
PRUint64 mContentLength;
|
||||
|
||||
PRBool mIsByteRangeRequest;
|
||||
nsInt64 mByteRangeStart;
|
||||
@ -174,11 +174,11 @@ protected:
|
||||
nsCOMPtr<nsISupports> mContext;
|
||||
nsCString mContentType;
|
||||
nsCString mContentDisposition;
|
||||
nsUint64 mContentLength;
|
||||
PRUint64 mContentLength;
|
||||
|
||||
char *mBuffer;
|
||||
PRUint32 mBufLen;
|
||||
nsUint64 mTotalSent;
|
||||
PRUint64 mTotalSent;
|
||||
PRBool mFirstOnData; // used to determine if we're in our first OnData callback.
|
||||
|
||||
// The following members are for tracking the byte ranges in
|
||||
|
@ -1068,7 +1068,7 @@ NS_IMETHODIMP nsDocLoader::OnProgress(nsIRequest *aRequest, nsISupports* ctxt,
|
||||
// so update mMaxSelfProgress... Otherwise, set it to -1 to indicate
|
||||
// that the content-length is no longer known.
|
||||
//
|
||||
if (nsUint64(aProgressMax) != LL_MAXUINT) {
|
||||
if (PRUint64(aProgressMax) != LL_MAXUINT) {
|
||||
mMaxSelfProgress += PRInt64(aProgressMax);
|
||||
info->mMaxProgress = PRInt64(aProgressMax);
|
||||
} else {
|
||||
|
@ -1280,7 +1280,7 @@ nsXPInstallManager::OnProgress(nsIRequest* request, nsISupports *ctxt, PRUint64
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
// XXX once channels support that, use 64-bit contentlength
|
||||
rv = mDlg->OnProgress( mNextItem-1, aProgress, nsUint64(mContentLength) );
|
||||
rv = mDlg->OnProgress( mNextItem-1, aProgress, PRUint64(mContentLength) );
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
Loading…
Reference in New Issue
Block a user