nsresult rv;
if (NS_FAILED(rv = gRDF->GetResource(aURL, getter_AddRefs(bookmark) ))) { NS_ERROR("unable to get bookmark resource"); return rv; }
nsBookmarksService::AddBookmark(const char *aURI, const PRUnichar *aOptionalTitle){	// XXX For the moment, just add it as a child of	// BookmarksRoot. Constructing a parser object to do this is so	// gross. We need to factor AddBookmark() into its own little	// routine or something.	BookmarkParser parser;	parser.Init(nsnull, mInner);	nsresult rv;	nsCOMPtr<nsIRDFContainer> container;	rv = nsComponentManager::CreateInstance(kRDFContainerCID,						nsnull,						nsIRDFContainer::GetIID(),						getter_AddRefs(container));	if (NS_FAILED(rv)) return rv;	rv = container->Init(mInner, kNC_BookmarksRoot);	if (NS_FAILED(rv)) return rv;	rv = parser.AddBookmark(container, aURI, aOptionalTitle,				0L, 0L, 0L, nsnull, kNC_Bookmark, nsnull);	if (NS_FAILED(rv)) return rv;	rv = Flush();	if (NS_FAILED(rv)) return rv;	return NS_OK;}