rv = remote->Init(uri);
rv = remote->Init(aURI);
RDFServiceImpl::GetDataSource(const char* uri, nsIRDFDataSource** aDataSource){    nsresult rv;    // First, check the cache to see if we already have this    // datasource loaded and initialized.    {        nsIRDFDataSource* cached =            NS_STATIC_CAST(nsIRDFDataSource*, PL_HashTableLookup(mNamedDataSources, uri));        if (cached) {            nsCOMPtr<nsIRDFRemoteDataSource> remote = do_QueryInterface(cached);            if (remote) {                rv = remote->Refresh(PR_FALSE);                if (NS_FAILED(rv)) return rv;            }            NS_ADDREF(cached);            *aDataSource = cached;            return NS_OK;        }    }    // Nope. So go to the repository to try to create it.    nsCOMPtr<nsIRDFDataSource> ds;	nsAutoString rdfName(uri);    static const char kRDFPrefix[] = "rdf:";    PRInt32 pos = rdfName.Find(kRDFPrefix);    if (pos == 0) {        // It's a built-in data source        nsAutoString dataSourceName;        rdfName.Right(dataSourceName, rdfName.Length() - (pos + sizeof(kRDFPrefix) - 1));        nsAutoString progIDStr(NS_RDF_DATASOURCE_PROGID_PREFIX);        progIDStr.Append(dataSourceName);        // Safely convert it to a C-string for the XPCOM APIs        char buf[64];        char* progID = buf, *p;        if (progIDStr.Length() >= PRInt32(sizeof buf))            progID = (char *)nsAllocator::Alloc(progIDStr.Length() + 1);        if (progID == nsnull)            return NS_ERROR_OUT_OF_MEMORY;        progIDStr.ToCString(progID, progIDStr.Length() + 1);        /* strip params to get ``base'' progID for data source */        p = PL_strchr(progID, ';');        if (p)            *p = '\0';        nsCOMPtr<nsISupports> isupports;        rv = nsServiceManager::GetService(progID, kISupportsIID, getter_AddRefs(isupports), nsnull);        if (progID != buf)            nsCRT::free(progID);        if (NS_FAILED(rv)) return rv;        ds = do_QueryInterface(isupports, &rv);        if (NS_FAILED(rv)) return rv;        nsCOMPtr<nsIRDFRemoteDataSource> remote = do_QueryInterface(ds);        if (remote) {            rv = remote->Init(uri);            if (NS_FAILED(rv)) return rv;        }    }    else {        // Try to load this as an RDF/XML data source        rv = nsComponentManager::CreateInstance(kRDFXMLDataSourceCID,                                                nsnull,                                                nsIRDFDataSource::GetIID(),                                                (void**) &ds);        if (NS_FAILED(rv)) return rv;        // Start the datasource load asynchronously. If you wanted it        // loaded synchronously, then you should've tried to do it        // yourself.        nsCOMPtr<nsIRDFRemoteDataSource> remote(do_QueryInterface(ds));        NS_ASSERTION(remote, "not a remote RDF/XML data source!");        if (! remote) return NS_ERROR_UNEXPECTED;        rv = remote->Init(uri);        if (NS_FAILED(rv)) return rv;        rv = remote->Refresh(PR_FALSE);        if (NS_FAILED(rv)) return rv;    }    *aDataSource = ds;    NS_ADDREF(*aDataSource);    return NS_OK;}