nsAsyncStreamObserver::Init(nsIStreamObserver* aObserver, nsIEventQueue* aEventQ) { nsresult rv = NS_OK; NS_ASSERTION(aObserver, "null observer"); mReceiver = aObserver;  NS_WITH_SERVICE(nsIEventQueueService, eventQService, kEventQueueService, &rv); if (NS_FAILED(rv)) return rv;  rv = eventQService->ResolveEventQueue(aEventQ, getter_AddRefs(mEventQueue)); return rv; }
void Init(nsIStreamObserver* aListener) { mReceiver = aListener; NS_ADDREF(mReceiver); }
nsAsyncStreamObserver::Init(nsIStreamObserver* aObserver, nsIEventQueue* aEventQ){    nsresult rv = NS_OK;    NS_ASSERTION(aObserver, "null observer");    mReceiver = aObserver;            NS_WITH_SERVICE(nsIEventQueueService, eventQService, kEventQueueService, &rv);    if (NS_FAILED(rv))     return rv;            rv = eventQService->ResolveEventQueue(aEventQ, getter_AddRefs(mEventQueue));    return rv;}