зеркало из https://github.com/mozilla/pjs.git
some bulletproofing code. I got a random crash here (sorry, I lost the stack) because the
downstreamlister was null. trying to reproduce. at least now it will only assert. r=mscott
This commit is contained in:
Родитель
4f8d8e455f
Коммит
b6b2110427
|
@ -119,7 +119,13 @@ public:
|
|||
NS_IMETHOD
|
||||
OnStartRequest(nsIChannel *channel, nsISupports *aContext) {
|
||||
nsresult rv;
|
||||
rv = mDownstreamListener->OnStartRequest(mChannel, aContext);
|
||||
|
||||
NS_ASSERTION(mDownstreamListener, "no downstream listener");
|
||||
|
||||
if (mDownstreamListener) {
|
||||
rv = mDownstreamListener->OnStartRequest(mChannel, aContext);
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
Cancel();
|
||||
return rv;
|
||||
|
@ -129,8 +135,14 @@ public:
|
|||
OnStopRequest(nsIChannel *channel, nsISupports *aContext,
|
||||
nsresult status, const PRUnichar *errorMsg) {
|
||||
nsresult rv;
|
||||
rv = mDownstreamListener->OnStopRequest(mChannel, aContext, status, errorMsg);
|
||||
mDownstreamListener = 0;
|
||||
|
||||
|
||||
NS_ASSERTION(mDownstreamListener, "no downstream listener");
|
||||
|
||||
if (mDownstreamListener) {
|
||||
rv = mDownstreamListener->OnStopRequest(mChannel, aContext, status, errorMsg);
|
||||
mDownstreamListener = 0;
|
||||
}
|
||||
// Tricky: causes this instance to be free'ed because mEventQueueStreamListener
|
||||
// has a circular reference back to this.
|
||||
mEventQueueStreamListener = 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче