simply adding some logging helpful for debugging event queue interactions. from bugscape bug 4890, bugzilla bug 84247 r=darin

This commit is contained in:
danm%netscape.com 2001-06-06 02:34:52 +00:00
Родитель b87a4d3a8f
Коммит d5a1528ea4
3 изменённых файлов: 11 добавлений и 0 удалений

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

@ -105,6 +105,7 @@ public:
return;
}
LOG(("handle startevent=%8lX\n",(long)this));
nsresult rv = mProxy->mObserver->OnStartRequest(mRequest, mContext);
if (NS_FAILED(rv)) {
LOG(("OnStartRequest failed [rv=%x] canceling request!\n", rv));
@ -155,6 +156,7 @@ public:
rv = mRequest->GetStatus(&status);
NS_ASSERTION(NS_SUCCEEDED(rv), "GetStatus failed for request!");
LOG(("handle stopevent=%8lX\n",(long)this));
(void) observer->OnStopRequest(mRequest, mContext, status);
}
};
@ -182,6 +184,7 @@ nsRequestObserverProxy::OnStartRequest(nsIRequest *request,
if (!ev)
return NS_ERROR_OUT_OF_MEMORY;
LOG(("post startevent=%8lX queue=%8lX\n",(long)ev,(long)mEventQ.get()));
nsresult rv = FireEvent(ev);
if (NS_FAILED(rv))
delete ev;
@ -206,6 +209,7 @@ nsRequestObserverProxy::OnStopRequest(nsIRequest *request,
if (!ev)
return NS_ERROR_OUT_OF_MEMORY;
LOG(("post stopevent=%8lX queue=%8lX\n",(long)ev,(long)mEventQ.get()));
nsresult rv = FireEvent(ev);
if (NS_FAILED(rv))
delete ev;

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

@ -45,6 +45,10 @@ public:
nsIRequestObserver *Observer() { return mObserver; }
nsresult FireEvent(nsARequestObserverEvent *);
#ifdef DEBUG
nsIEventQueue *GetEventQueue()
{ return mEventQ.get(); } // debugging-only; no addref
#endif
nsresult SetEventQueue(nsIEventQueue *);
protected:

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

@ -167,6 +167,8 @@ nsOnDataAvailableEvent::HandleEvent()
nsCOMPtr<nsIStreamListener> listener;
rv = mProxy->GetListener(getter_AddRefs(listener));
LOG(("handle dataevent=%8lX\n",(long)this));
// Forward call to listener
if (listener)
rv = listener->OnDataAvailable(mRequest, mContext,
@ -324,6 +326,7 @@ nsStreamListenerProxy::OnDataAvailable(nsIRequest *request,
if (!ev) return NS_ERROR_OUT_OF_MEMORY;
// Reuse the event queue of the observer proxy
LOG(("post dataevent=%8lX queue=%8lX\n",(long)ev,(long)mObserverProxy->GetEventQueue()));
rv = mObserverProxy->FireEvent(ev);
if (NS_FAILED(rv))
delete ev;