Bug 1036056 - Remove dangerous public destructor of nsFileUploadContentStream r=mcmanus

This commit is contained in:
Steve Workman 2014-07-09 11:02:06 -07:00
Родитель 94e53dc0be
Коммит 972e966190
1 изменённых файлов: 4 добавлений и 11 удалений

Просмотреть файл

@ -178,20 +178,14 @@ public:
uint32_t count, nsIEventTarget *target);
private:
virtual ~nsFileUploadContentStream() {}
void OnCopyComplete();
nsRefPtr<nsFileCopyEvent> mCopyEvent;
nsCOMPtr<nsITransportEventSink> mSink;
};
namespace mozilla {
template<>
struct HasDangerousPublicDestructor<nsFileUploadContentStream>
{
static const bool value = true;
};
}
NS_IMPL_ISUPPORTS_INHERITED0(nsFileUploadContentStream,
nsBaseContentStream)
@ -365,14 +359,13 @@ nsFileChannel::OpenContentStream(bool async, nsIInputStream **result,
if (NS_FAILED(rv))
return rv;
nsFileUploadContentStream *uploadStream =
nsRefPtr<nsFileUploadContentStream> uploadStream =
new nsFileUploadContentStream(async, fileStream, mUploadStream,
mUploadLength, this);
if (!uploadStream || !uploadStream->IsInitialized()) {
delete uploadStream;
return NS_ERROR_OUT_OF_MEMORY;
}
stream = uploadStream;
stream = uploadStream.forget();
mContentLength = 0;