Hi, I'm trying to get responses but I can't seem to figure out how to use nsiTraceableChannel. What I already did is that i registered an observer for http-on-modify-request and http-on-examine-response, which is working just fine. Now what I'm trying to do is use nsiTraceableChannel to replace a stream listener with my own which i implemented. This code is not working:
... nsresult rv; ... if(strcmp(aTopic, "http-on-examine-response")) { nsCOMPtr<nsITraceableChannel> traceableChannel = do_QueryInterface(aSubject, &rv); MyListener *myListener = new MyListener; //nsCOMPtry<MyListener> myListener = new MyListener; //i tried this way too rv = traceableChannel->SetNewListener(myListener, getter_AddRefs(myListener->mListener)); //I put the nsCOMPtr<nsIStreamListener> mListener; into the implementation of nsIStreamListener ... } It seems not to work. Am I doing something wrong (maybe i should create my object in a diferent way)? Because my implementation of onStartRequest, onDataAvailable and onStopRequest are never called. In rv (nsresult) i get 0 (NS_OK). But it seems that the listener was never replaced. I would realy apreciate your help. Thank you in advanced for your help! _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform