nsresult	rv = NS_ERROR_OUT_OF_MEMORY;  if (NS_FAILED(rv = nsComponentManager::CreateInstance(kRDFInMemoryDataSourceCID, nsnull, NS_GET_IID(nsIRDFDataSource), (void **)&mInner))) return(rv);   if (NS_FAILED(rv = gRDFService->GetDataSource("rdf:local-store", getter_AddRefs(mLocalstore)))) return(rv);  if (NS_FAILED(rv = NS_NewISupportsArray(getter_AddRefs(mUpdateArray)))) return(rv);   if (NS_FAILED(rv = gRDFService->RegisterDataSource(this, PR_FALSE))) return(rv);  rv = NS_NewLoadGroup(getter_AddRefs(mLoadGroup), nsnull); PR_ASSERT(NS_SUCCEEDED(rv));  if (!mTimer) { busySchedule = PR_FALSE; mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv); if (mTimer) { mTimer->Init(InternetSearchDataSource::FireTimer, this, SEARCH_UPDATE_TIMEOUT, NS_PRIORITY_LOWEST, NS_TYPE_REPEATING_SLACK);   } }  mEngineListBuilt = PR_FALSE;   nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1", &rv); if (observerService) { observerService->AddObserver(this, "profile-before-change", PR_TRUE); observerService->AddObserver(this, "profile-do-change", PR_TRUE); }  return(rv);
return(NS_OK);
InternetSearchDataSource::Init(){	nsresult	rv = NS_ERROR_OUT_OF_MEMORY;	if (NS_FAILED(rv = nsComponentManager::CreateInstance(kRDFInMemoryDataSourceCID,		nsnull, NS_GET_IID(nsIRDFDataSource), (void **)&mInner)))		return(rv);	// get localstore, as we'll be using it	if (NS_FAILED(rv = gRDFService->GetDataSource("rdf:local-store", getter_AddRefs(mLocalstore))))		return(rv);	if (NS_FAILED(rv = NS_NewISupportsArray(getter_AddRefs(mUpdateArray))))		return(rv);	// register this as a named data source with the service manager	if (NS_FAILED(rv = gRDFService->RegisterDataSource(this, PR_FALSE)))		return(rv);	rv = NS_NewLoadGroup(getter_AddRefs(mLoadGroup), nsnull);	PR_ASSERT(NS_SUCCEEDED(rv));	if (!mTimer)	{		busySchedule = PR_FALSE;		mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);		if (mTimer)		{			mTimer->Init(InternetSearchDataSource::FireTimer, this,			     SEARCH_UPDATE_TIMEOUT, NS_PRIORITY_LOWEST, NS_TYPE_REPEATING_SLACK);			// Note: don't addref "this" as we'll cancel the timer in the			//       InternetSearchDataSource destructor		}	}	mEngineListBuilt = PR_FALSE;	// Register as a profile change obsevrer  nsCOMPtr<nsIObserverService> observerService =            do_GetService("@mozilla.org/observer-service;1", &rv);  if (observerService) {    observerService->AddObserver(this, "profile-before-change", PR_TRUE);    observerService->AddObserver(this, "profile-do-change", PR_TRUE);  }	return(rv);}