nsCAutoString			caturiC; caturiC.AssignWithConversion(catURI); if (NS_FAILED(rv = gRDFService->GetResource(caturiC.get(),
if (NS_FAILED(rv = gRDFService->GetResource(nsCAutoString(catURI),
InternetSearchDataSource::GetTargets(nsIRDFResource *source,                           nsIRDFResource *property,                           PRBool tv,                           nsISimpleEnumerator **targets /* out */){	NS_PRECONDITION(source != nsnull, "null ptr");	if (! source)		return NS_ERROR_NULL_POINTER;	NS_PRECONDITION(property != nsnull, "null ptr");	if (! property)		return NS_ERROR_NULL_POINTER;	NS_PRECONDITION(targets != nsnull, "null ptr");	if (! targets)		return NS_ERROR_NULL_POINTER;	nsresult rv = NS_RDF_NO_VALUE;	// we only have positive assertions in the internet search data source.	if (! tv)		return(rv);	if ((isSearchCategoryURI(source)) && (categoryDataSource))	{		const char	*uri = nsnull;		source->GetValueConst(&uri);		if (!uri)	return(NS_ERROR_UNEXPECTED);		nsAutoString	catURI;		catURI.AssignWithConversion(uri);		nsCOMPtr<nsIRDFResource>	category;		nsCAutoString			caturiC;		caturiC.AssignWithConversion(catURI);		if (NS_FAILED(rv = gRDFService->GetResource(caturiC.get(),			getter_AddRefs(category))))			return(rv);		rv = categoryDataSource->GetTargets(category, property, tv, targets);		return(rv);	}	if (isSearchCategoryEngineURI(source))	{		nsCOMPtr<nsIRDFResource>	trueEngine;		rv = resolveSearchCategoryEngineURI(source, getter_AddRefs(trueEngine));		if (NS_FAILED(rv) || (rv == NS_RDF_NO_VALUE))	return(rv);		if (!trueEngine)	return(NS_RDF_NO_VALUE);		source = trueEngine;	}	if (mInner)	{			rv = mInner->GetTargets(source, property, tv, targets);		// defer search engine discovery until needed; small startup time improvement		if (((source == kNC_SearchEngineRoot) || isSearchURI(source)) && (property == kNC_Child)			&& (mEngineListBuilt == PR_FALSE))		{			DeferredInit();		}	}	if (isSearchURI(source))	{		if (property == kNC_Child)		{			PRBool		doNetworkRequest = PR_TRUE;			if (NS_SUCCEEDED(rv) && (targets))			{				// check and see if we already have data for the search in question;				// if we do, BeginSearchRequest() won't bother doing the search again,				// otherwise it will kickstart it				PRBool		hasResults = PR_FALSE;				if (NS_SUCCEEDED((*targets)->HasMoreElements(&hasResults)) && (hasResults == PR_TRUE))				{					doNetworkRequest = PR_FALSE;				}			}			BeginSearchRequest(source, doNetworkRequest);		}	}	return(rv);}