rv = parser.AddBookmark(container, aURI, aOptionalTitle, now32, 0L, 0L, nsnull, kNC_Bookmark, nsnull);
if ((nsnull != aOptionalTitle) && (*aOptionalTitle != PRUnichar('\0'))) { nsCOMPtr<nsIRDFLiteral> literal; if (NS_FAILED(rv = gRDF->GetLiteral(aOptionalTitle, getter_AddRefs(literal)))) { NS_ERROR("unable to create literal for bookmark name"); } if (NS_SUCCEEDED(rv)) { rv = mDataSource->Assert(bookmark, kNC_Name, literal, PR_TRUE); if (rv != NS_RDF_ASSERTION_ACCEPTED) { NS_ERROR("unable to set bookmark name"); } } }
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;	// convert the current date/time from microseconds (PRTime) to seconds	PRTime		now64 = PR_Now(), million;	LL_I2L(million, PR_USEC_PER_SEC);	LL_DIV(now64, now64, million);	PRInt32		now32;	LL_L2I(now32, now64);	rv = parser.AddBookmark(container, aURI, aOptionalTitle, now32,				0L, 0L, nsnull, kNC_Bookmark, nsnull);	if (NS_FAILED(rv)) return rv;	mDirty = PR_TRUE;	return(NS_OK);}