NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF container utils");  gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_SearchEngineRoot), &kNC_SearchEngineRoot); gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_LastSearchRoot), &kNC_LastSearchRoot); gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_SearchResultsSitesRoot), &kNC_SearchResultsSitesRoot); gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_FilterSearchURLsRoot), &kNC_FilterSearchURLsRoot); gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_FilterSearchSitesRoot), &kNC_FilterSearchSitesRoot); gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_SearchCategoryRoot), &kNC_SearchCategoryRoot); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "SearchMode"), &kNC_LastSearchMode);  gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "searchtype"), &kNC_SearchType); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "SearchResult"), &kNC_SearchResult); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "ref"), &kNC_Ref); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "child"), &kNC_Child); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "title"), &kNC_Title); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "data"), &kNC_Data); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Name"), &kNC_Name); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Description"), &kNC_Description); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Version"), &kNC_Version); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "actionButton"), &kNC_actionButton); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "actionBar"), &kNC_actionBar); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "searchForm"), &kNC_searchForm); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "LastText"), &kNC_LastText); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "URL"), &kNC_URL); gRDFService->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "instanceOf"), &kRDF_InstanceOf); gRDFService->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "type"), &kRDF_type); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "loading"), &kNC_loading); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "HTML"), &kNC_HTML); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Icon"), &kNC_Icon); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "StatusIcon"), &kNC_StatusIcon); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Banner"), &kNC_Banner); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Site"), &kNC_Site); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Relevance"), &kNC_Relevance); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Relevance?sort=true"), &kNC_RelevanceSort); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Date"), &kNC_Date); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "PageRank"), &kNC_PageRank); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Engine"), &kNC_Engine); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Price"), &kNC_Price); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Price?sort=true"), &kNC_PriceSort); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Availability"), &kNC_Availability); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "BookmarkSeparator"), &kNC_BookmarkSeparator); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Update"), &kNC_Update); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "UpdateIcon"), &kNC_UpdateIcon); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "UpdateCheckDays"), &kNC_UpdateCheckDays); gRDFService->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "LastPingDate"), &kWEB_LastPingDate); gRDFService->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "LastPingModDate"), &kWEB_LastPingModDate); gRDFService->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "LastPingContentLen"), &kWEB_LastPingContentLen);  gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=addtobookmarks"), &kNC_SearchCommand_AddToBookmarks); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=addquerytobookmarks"), &kNC_SearchCommand_AddQueryToBookmarks); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=filterresult"), &kNC_SearchCommand_FilterResult); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=filtersite"), &kNC_SearchCommand_FilterSite); gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=clearfilters"), &kNC_SearchCommand_ClearFilters);  gRDFService->GetLiteral(NS_LITERAL_STRING("true").get(), &kTrueLiteral);  rv = nsServiceManager::GetService(kPrefCID, NS_GET_IID(nsIPref), getter_AddRefs(prefs)); if (NS_SUCCEEDED(rv) && (prefs)) { prefs->RegisterCallback("browser.search.mode", searchModePrefCallback, this); prefs->GetIntPref("browser.search.mode", &gBrowserSearchMode); }
gRDFService->GetResource(kURINC_SearchEngineRoot,                &kNC_SearchEngineRoot); gRDFService->GetResource(kURINC_LastSearchRoot,                  &kNC_LastSearchRoot); gRDFService->GetResource(kURINC_SearchResultsSitesRoot,          &kNC_SearchResultsSitesRoot); gRDFService->GetResource(NC_NAMESPACE_URI "SearchCategoryRoot",  &kNC_SearchCategoryRoot); gRDFService->GetResource(NC_NAMESPACE_URI "ref",                 &kNC_Ref); gRDFService->GetResource(NC_NAMESPACE_URI "child",               &kNC_Child); gRDFService->GetResource(NC_NAMESPACE_URI "data",                &kNC_Data); gRDFService->GetResource(NC_NAMESPACE_URI "Name",                &kNC_Name); gRDFService->GetResource(NC_NAMESPACE_URI "Description",         &kNC_Description); gRDFService->GetResource(NC_NAMESPACE_URI "URL",                 &kNC_URL); gRDFService->GetResource(RDF_NAMESPACE_URI "instanceOf",         &kRDF_InstanceOf); gRDFService->GetResource(RDF_NAMESPACE_URI "type",               &kRDF_type); gRDFService->GetResource(NC_NAMESPACE_URI "loading",             &kNC_loading); gRDFService->GetResource(NC_NAMESPACE_URI "HTML",                &kNC_HTML); gRDFService->GetResource(NC_NAMESPACE_URI "Icon",                &kNC_Icon); gRDFService->GetResource(NC_NAMESPACE_URI "StatusIcon",          &kNC_StatusIcon); gRDFService->GetResource(NC_NAMESPACE_URI "Banner",              &kNC_Banner); gRDFService->GetResource(NC_NAMESPACE_URI "Site",                &kNC_Site); gRDFService->GetResource(NC_NAMESPACE_URI "Relevance",           &kNC_Relevance); gRDFService->GetResource(NC_NAMESPACE_URI "Relevance?sort=true", &kNC_RelevanceSort); gRDFService->GetResource(NC_NAMESPACE_URI "Engine",              &kNC_Engine); gRDFService->GetResource(NC_NAMESPACE_URI "Price",               &kNC_Price); gRDFService->GetResource(NC_NAMESPACE_URI "Price?sort=true",     &kNC_PriceSort); gRDFService->GetResource(NC_NAMESPACE_URI "Availability",        &kNC_Availability);
InternetSearchDataSource::InternetSearchDataSource(void){	if (gRefCnt++ == 0)	{		nsresult rv = nsServiceManager::GetService(kRDFServiceCID,			NS_GET_IID(nsIRDFService), (nsISupports**) &gRDFService);		PR_ASSERT(NS_SUCCEEDED(rv));		rv = nsServiceManager::GetService(kRDFContainerUtilsCID,						  NS_GET_IID(nsIRDFContainerUtils),						  (nsISupports**) &gRDFC);		NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF container utils");		gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_SearchEngineRoot),                             &kNC_SearchEngineRoot);		gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_LastSearchRoot),                             &kNC_LastSearchRoot);		gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_SearchResultsSitesRoot),                             &kNC_SearchResultsSitesRoot);		gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_FilterSearchURLsRoot),                             &kNC_FilterSearchURLsRoot);		gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_FilterSearchSitesRoot),                             &kNC_FilterSearchSitesRoot);		gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_SearchCategoryRoot),                             &kNC_SearchCategoryRoot);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "SearchMode"),                             &kNC_LastSearchMode);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "searchtype"),                             &kNC_SearchType);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "SearchResult"),                             &kNC_SearchResult);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "ref"),                             &kNC_Ref);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "child"),                             &kNC_Child);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "title"),                             &kNC_Title);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "data"),                             &kNC_Data);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Name"),                             &kNC_Name);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Description"),                             &kNC_Description);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Version"),                             &kNC_Version);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "actionButton"),                             &kNC_actionButton);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "actionBar"),                             &kNC_actionBar);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "searchForm"),                             &kNC_searchForm);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "LastText"),                             &kNC_LastText);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "URL"),                             &kNC_URL);		gRDFService->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "instanceOf"),                             &kRDF_InstanceOf);		gRDFService->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "type"),                             &kRDF_type);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "loading"),                             &kNC_loading);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "HTML"),                             &kNC_HTML);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Icon"),                             &kNC_Icon);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "StatusIcon"),                             &kNC_StatusIcon);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Banner"),                             &kNC_Banner);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Site"),                             &kNC_Site);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Relevance"),                             &kNC_Relevance);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Relevance?sort=true"),                             &kNC_RelevanceSort);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Date"),                             &kNC_Date);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "PageRank"),                             &kNC_PageRank);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Engine"),                             &kNC_Engine);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Price"),                             &kNC_Price);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Price?sort=true"),                             &kNC_PriceSort);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Availability"),                             &kNC_Availability);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "BookmarkSeparator"),                             &kNC_BookmarkSeparator);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Update"),                             &kNC_Update);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "UpdateIcon"),                             &kNC_UpdateIcon);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "UpdateCheckDays"),                             &kNC_UpdateCheckDays);		gRDFService->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "LastPingDate"),                             &kWEB_LastPingDate);		gRDFService->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "LastPingModDate"),                             &kWEB_LastPingModDate);		gRDFService->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "LastPingContentLen"),                             &kWEB_LastPingContentLen);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=addtobookmarks"),                             &kNC_SearchCommand_AddToBookmarks);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=addquerytobookmarks"),                             &kNC_SearchCommand_AddQueryToBookmarks);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=filterresult"),                             &kNC_SearchCommand_FilterResult);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=filtersite"),                             &kNC_SearchCommand_FilterSite);		gRDFService->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=clearfilters"),                             &kNC_SearchCommand_ClearFilters);		gRDFService->GetLiteral(NS_LITERAL_STRING("true").get(), &kTrueLiteral);		rv = nsServiceManager::GetService(kPrefCID, NS_GET_IID(nsIPref), getter_AddRefs(prefs));		if (NS_SUCCEEDED(rv) && (prefs))		{			prefs->RegisterCallback("browser.search.mode", searchModePrefCallback, this);			prefs->GetIntPref("browser.search.mode", &gBrowserSearchMode);		}	}}