This commit is contained in:
warren%netscape.com 2000-01-05 09:28:35 +00:00
Родитель 1aaebda95e
Коммит 5370d83dc2
2 изменённых файлов: 24 добавлений и 18 удалений

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

@ -340,8 +340,7 @@ nsFileTransport::Init(nsIFileSystem* fsObj, const char* command,
nsFileTransport::~nsFileTransport()
{
if (mState != CLOSED) {
mState = CLOSING;
Process();
DoClose();
}
NS_ASSERTION(mSource == nsnull, "transport not closed");
NS_ASSERTION(mBufferInputStream == nsnull, "transport not closed");
@ -991,22 +990,7 @@ nsFileTransport::Process(void)
}
case CLOSING: {
PR_LOG(gFileTransportLog, PR_LOG_DEBUG,
("nsFileTransport: CLOSING [this=%x %s] status=%x",
this, (const char*)mSpec, mStatus));
if (mOpenObserver) {
(void)mOpenObserver->OnStopRequest(this, mOpenContext,
mStatus, nsnull); // XXX fix error message
mOpenObserver = null_nsCOMPtr();
mOpenContext = null_nsCOMPtr();
}
if (mFileObject) {
nsresult rv = mFileObject->Close(mStatus);
NS_ASSERTION(NS_SUCCEEDED(rv), "unexpected Close failure");
mFileObject = null_nsCOMPtr();
}
mState = CLOSED;
DoClose();
break;
}
@ -1017,6 +1001,27 @@ nsFileTransport::Process(void)
}
}
void
nsFileTransport::DoClose(void)
{
PR_LOG(gFileTransportLog, PR_LOG_DEBUG,
("nsFileTransport: CLOSING [this=%x %s] status=%x",
this, (const char*)mSpec, mStatus));
if (mOpenObserver) {
(void)mOpenObserver->OnStopRequest(this, mOpenContext,
mStatus, nsnull); // XXX fix error message
mOpenObserver = null_nsCOMPtr();
mOpenContext = null_nsCOMPtr();
}
if (mFileObject) {
nsresult rv = mFileObject->Close(mStatus);
NS_ASSERTION(NS_SUCCEEDED(rv), "unexpected Close failure");
mFileObject = null_nsCOMPtr();
}
mState = CLOSED;
}
////////////////////////////////////////////////////////////////////////////////
// nsIPipeObserver methods:
////////////////////////////////////////////////////////////////////////////////

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

@ -75,6 +75,7 @@ public:
PRUint32 bufferMaxSize);
void Process(void);
void DoClose(void);
enum State {
CLOSED,