NS_ADDREF(*result = channel);
*result = channel;
NS_NewChannel(nsIChannel **result,               nsIURI *uri,              nsILoadGroup *loadGroup,              nsIInterfaceRequestor *notificationCallbacks,              PRUint32 loadFlags){    ENSURE_IOSERVICE();    nsresult rv;    nsCOMPtr<nsIChannel> channel;    rv = gIOS->NewChannelFromURI(uri, getter_AddRefs(channel));    if (NS_FAILED(rv)) return rv;    if (loadGroup) {        rv = channel->SetLoadGroup(loadGroup);        if (NS_FAILED(rv)) return rv;    }    if (notificationCallbacks) {        rv = channel->SetNotificationCallbacks(notificationCallbacks);        if (NS_FAILED(rv)) return rv;    }    if (loadFlags != nsIRequest::LOAD_NORMAL) {        rv = channel->SetLoadFlags(loadFlags);        if (NS_FAILED(rv)) return rv;    }    NS_ADDREF(*result = channel);    return rv;}