NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF service"); if (NS_FAILED(rv)) return(rv);
gRDFService->GetResource(kURINC_RelatedLinksRoot, &kNC_RelatedLinksRoot); gRDFService->GetResource(RDF_NAMESPACE_URI "type", &kRDF_type); gRDFService->GetResource(NC_NAMESPACE_URI "RelatedLinksTopic", &kNC_RelatedLinksTopic); gRDFService->GetResource(NC_NAMESPACE_URI "child", &kNC_Child);
RelatedLinksStreamListener::Init(){	if (gRefCnt++ == 0)	{		nsresult rv = nsServiceManager::GetService(kRDFServiceCID,				    NS_GET_IID(nsIRDFService),				    (nsISupports**) &gRDFService);		NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF service");		if (NS_FAILED(rv))			return(rv);		nsICharsetConverterManager	*charsetConv = nsnull;		rv = nsServiceManager::GetService(kCharsetConverterManagerCID, 				NS_GET_IID(nsICharsetConverterManager), 				(nsISupports**)&charsetConv);		if (NS_SUCCEEDED(rv) && (charsetConv))		{			nsString	utf8("UTF-8");			rv = charsetConv->GetUnicodeDecoder(&utf8,				getter_AddRefs(mUnicodeDecoder));			NS_RELEASE(charsetConv);		}		gRDFService->GetResource(NC_NAMESPACE_URI "child", &kNC_Child);		gRDFService->GetResource(NC_NAMESPACE_URI "Name",  &kNC_Name);		gRDFService->GetResource(NC_NAMESPACE_URI "URL",   &kNC_URL);		gRDFService->GetResource(NC_NAMESPACE_URI "loading", &kNC_loading);		gRDFService->GetResource(NC_NAMESPACE_URI "BookmarkSeparator", &kNC_BookmarkSeparator);		gRDFService->GetResource(NC_NAMESPACE_URI "RelatedLinksTopic", &kNC_RelatedLinksTopic);		gRDFService->GetResource(RDF_NAMESPACE_URI "type", &kRDF_type);		gRDFService->GetResource(kURINC_RelatedLinksRoot, &kNC_RelatedLinksRoot);	 }	 mParentArray.AppendElement(kNC_RelatedLinksRoot);	 return(NS_OK);}