зеркало из https://github.com/mozilla/pjs.git
simply adding some logging helpful for debugging event queue interactions. from bugscape bug 4890, bugzilla bug 84247 r=darin
This commit is contained in:
Родитель
b87a4d3a8f
Коммит
d5a1528ea4
|
@ -105,6 +105,7 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG(("handle startevent=%8lX\n",(long)this));
|
||||||
nsresult rv = mProxy->mObserver->OnStartRequest(mRequest, mContext);
|
nsresult rv = mProxy->mObserver->OnStartRequest(mRequest, mContext);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
LOG(("OnStartRequest failed [rv=%x] canceling request!\n", rv));
|
LOG(("OnStartRequest failed [rv=%x] canceling request!\n", rv));
|
||||||
|
@ -155,6 +156,7 @@ public:
|
||||||
rv = mRequest->GetStatus(&status);
|
rv = mRequest->GetStatus(&status);
|
||||||
NS_ASSERTION(NS_SUCCEEDED(rv), "GetStatus failed for request!");
|
NS_ASSERTION(NS_SUCCEEDED(rv), "GetStatus failed for request!");
|
||||||
|
|
||||||
|
LOG(("handle stopevent=%8lX\n",(long)this));
|
||||||
(void) observer->OnStopRequest(mRequest, mContext, status);
|
(void) observer->OnStopRequest(mRequest, mContext, status);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -182,6 +184,7 @@ nsRequestObserverProxy::OnStartRequest(nsIRequest *request,
|
||||||
if (!ev)
|
if (!ev)
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
LOG(("post startevent=%8lX queue=%8lX\n",(long)ev,(long)mEventQ.get()));
|
||||||
nsresult rv = FireEvent(ev);
|
nsresult rv = FireEvent(ev);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
delete ev;
|
delete ev;
|
||||||
|
@ -206,6 +209,7 @@ nsRequestObserverProxy::OnStopRequest(nsIRequest *request,
|
||||||
if (!ev)
|
if (!ev)
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
LOG(("post stopevent=%8lX queue=%8lX\n",(long)ev,(long)mEventQ.get()));
|
||||||
nsresult rv = FireEvent(ev);
|
nsresult rv = FireEvent(ev);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
delete ev;
|
delete ev;
|
||||||
|
|
|
@ -45,6 +45,10 @@ public:
|
||||||
nsIRequestObserver *Observer() { return mObserver; }
|
nsIRequestObserver *Observer() { return mObserver; }
|
||||||
|
|
||||||
nsresult FireEvent(nsARequestObserverEvent *);
|
nsresult FireEvent(nsARequestObserverEvent *);
|
||||||
|
#ifdef DEBUG
|
||||||
|
nsIEventQueue *GetEventQueue()
|
||||||
|
{ return mEventQ.get(); } // debugging-only; no addref
|
||||||
|
#endif
|
||||||
nsresult SetEventQueue(nsIEventQueue *);
|
nsresult SetEventQueue(nsIEventQueue *);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -167,6 +167,8 @@ nsOnDataAvailableEvent::HandleEvent()
|
||||||
nsCOMPtr<nsIStreamListener> listener;
|
nsCOMPtr<nsIStreamListener> listener;
|
||||||
rv = mProxy->GetListener(getter_AddRefs(listener));
|
rv = mProxy->GetListener(getter_AddRefs(listener));
|
||||||
|
|
||||||
|
LOG(("handle dataevent=%8lX\n",(long)this));
|
||||||
|
|
||||||
// Forward call to listener
|
// Forward call to listener
|
||||||
if (listener)
|
if (listener)
|
||||||
rv = listener->OnDataAvailable(mRequest, mContext,
|
rv = listener->OnDataAvailable(mRequest, mContext,
|
||||||
|
@ -324,6 +326,7 @@ nsStreamListenerProxy::OnDataAvailable(nsIRequest *request,
|
||||||
if (!ev) return NS_ERROR_OUT_OF_MEMORY;
|
if (!ev) return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
// Reuse the event queue of the observer proxy
|
// Reuse the event queue of the observer proxy
|
||||||
|
LOG(("post dataevent=%8lX queue=%8lX\n",(long)ev,(long)mObserverProxy->GetEventQueue()));
|
||||||
rv = mObserverProxy->FireEvent(ev);
|
rv = mObserverProxy->FireEvent(ev);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
delete ev;
|
delete ev;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче