Merge m-c to inbound

This commit is contained in:
Ryan VanderMeulen 2012-06-09 19:01:38 -04:00
commit a811d9eed6
2 changed files with 8 additions and 4 deletions

View File

@ -36,7 +36,8 @@ FileHelper::FileHelper(LockedFile* aLockedFile,
FileHelper::~FileHelper()
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
NS_ASSERTION(!mFileStorage && !mLockedFile && !mFileRequest && !mListener &&
!mRequest, "Should have cleared this!");
}
NS_IMPL_THREADSAFE_ISUPPORTS1(FileHelper, nsIRequestObserver)

View File

@ -244,9 +244,12 @@ nsAsyncStreamCopier::AsyncCopy(nsIRequestObserver *observer, nsISupports *ctx)
// we want to receive progress notifications; release happens in
// OnAsyncCopyComplete.
NS_ADDREF_THIS();
rv = NS_AsyncCopy(mSource, mSink, mTarget, mMode, mChunkSize,
OnAsyncCopyComplete, this, mCloseSource, mCloseSink,
getter_AddRefs(mCopierCtx));
{
MutexAutoLock lock(mLock);
rv = NS_AsyncCopy(mSource, mSink, mTarget, mMode, mChunkSize,
OnAsyncCopyComplete, this, mCloseSource, mCloseSink,
getter_AddRefs(mCopierCtx));
}
if (NS_FAILED(rv)) {
NS_RELEASE_THIS();
Cancel(rv);