rv = gRDFService->GetResource(kURICHROME_content, &kCHROME_platform); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource"); if (NS_FAILED(rv)) return rv;  rv = gRDFService->GetResource(kURICHROME_content, &kCHROME_locale); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource"); if (NS_FAILED(rv)) return rv;  rv = gRDFService->GetResource(kURICHROME_content, &kCHROME_behavior);
rv = gRDFService->GetResource(kURICHROME_locale, &kCHROME_locale);
nsChromeRegistry::InitRegistry(){    gRefCnt++;    if (gRefCnt == 1) {        nsresult rv;        rv = nsServiceManager::GetService(kRDFServiceCID,                                          kIRDFServiceIID,                                          (nsISupports**)&gRDFService);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF service");        if (NS_FAILED(rv)) return rv;        // get all the properties we'll need:        rv = gRDFService->GetResource(kURICHROME_chrome, &kCHROME_chrome);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");        if (NS_FAILED(rv)) return rv;        rv = gRDFService->GetResource(kURICHROME_skin, &kCHROME_skin);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");        if (NS_FAILED(rv)) return rv;        rv = gRDFService->GetResource(kURICHROME_content, &kCHROME_content);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");        if (NS_FAILED(rv)) return rv;        rv = gRDFService->GetResource(kURICHROME_content, &kCHROME_platform);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");        if (NS_FAILED(rv)) return rv;        rv = gRDFService->GetResource(kURICHROME_content, &kCHROME_locale);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");        if (NS_FAILED(rv)) return rv;        rv = gRDFService->GetResource(kURICHROME_content, &kCHROME_behavior);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");        if (NS_FAILED(rv)) return rv;        rv = gRDFService->GetResource(kURICHROME_base, &kCHROME_base);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");        if (NS_FAILED(rv)) return rv;        rv = gRDFService->GetResource(kURICHROME_main, &kCHROME_main);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");        if (NS_FAILED(rv)) return rv;        rv = gRDFService->GetResource(kURICHROME_archive, &kCHROME_archive);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");        if (NS_FAILED(rv)) return rv;        rv = gRDFService->GetResource(kURICHROME_name, &kCHROME_name);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");        if (NS_FAILED(rv)) return rv;        rv = gRDFService->GetResource(kURICHROME_displayname, &kCHROME_displayname);        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");        if (NS_FAILED(rv)) return rv;        rv = nsComponentManager::CreateInstance(kRDFXMLDataSourceCID,                                                nsnull,                                                nsIRDFDataSource::GetIID(),                                                (void**) &mInner);        if (NS_FAILED(rv)) return rv;        nsCOMPtr<nsIRDFRemoteDataSource> remote = do_QueryInterface(mInner);        if (! remote)            return NS_ERROR_UNEXPECTED;        // Retrieve the mInner data source.        nsSpecialSystemDirectory chromeFile(nsSpecialSystemDirectory::OS_CurrentProcessDirectory);        chromeFile += "chrome";        chromeFile += "registry.rdf";        nsFileURL chromeURL(chromeFile);        const char* innerURI = chromeURL.GetAsString();        rv = remote->Init(innerURI);        if (NS_FAILED(rv)) return rv;    }    nsCOMPtr<nsIRDFRemoteDataSource> remote = do_QueryInterface(mInner);    if (! remote)        return NS_ERROR_UNEXPECTED;    // We need to read this synchronously.    nsresult rv = remote->Refresh(PR_TRUE);    if (NS_FAILED(rv)) return rv;        return NS_OK;}