nsresult nsJSChannel::Init(nsIURI *aURI)
nsresult nsJSThunk::Init(nsIURI* uri, nsIChannel* channel)
nsresult nsJSChannel::Init(nsIURI *aURI){    nsresult rv;        // Create the nsIStreamIO layer used by the nsIStreamIOChannel.    mIOThunk= new nsJSThunk();    if (mIOThunk == nsnull)        return NS_ERROR_OUT_OF_MEMORY;    NS_ADDREF(mIOThunk);    // Create a stock nsIStreamIOChannel...    // Remember, until AsyncOpen is called, the script will not be evaluated    // and the underlying Input Stream will not be created...    nsCOMPtr<nsIStreamIOChannel> channel;    rv = NS_NewStreamIOChannel(getter_AddRefs(channel), aURI, mIOThunk);    if (NS_FAILED(rv)) return rv;    rv = mIOThunk->Init(aURI, channel);    if (NS_SUCCEEDED(rv)) {        mStreamChannel = do_QueryInterface(channel);    }    return rv;}