nsresult rv; if ((aSource == kNC_HistoryRoot || aSource == kNC_HistoryByDate || IsFindResource(aSource)) && aProperty == kNC_child) {  nsCOMPtr<nsIRDFResource> resource = do_QueryInterface(aTarget, &rv); if (NS_FAILED(rv)) return NS_RDF_ASSERTION_REJECTED;  const char* targetUrl; rv = resource->GetValueConst(&targetUrl); if (NS_FAILED(rv)) return NS_RDF_ASSERTION_REJECTED;  if (IsFindResource(resource)) {  searchQuery query; rv = FindUrlToSearchQuery(targetUrl, query); if (NS_FAILED(rv)) return NS_RDF_ASSERTION_REJECTED;  matchQuery_t matchQuery; matchQuery.history = this; matchQuery.query = &query; rv = RemoveMatchingRows(matchQueryCallback, (void*)&matchQuery, PR_TRUE); FreeSearchQuery(query); if (NS_FAILED(rv)) return NS_RDF_ASSERTION_REJECTED;     if (!mBatchesInProgress) NotifyUnassert(aSource, aProperty, aTarget);  return NS_OK; }   rv = RemovePage(targetUrl); if (NS_FAILED(rv)) return NS_RDF_ASSERTION_REJECTED;  return NS_OK; }
nsGlobalHistory::Unassert(nsIRDFResource* aSource,                          nsIRDFResource* aProperty,                          nsIRDFNode* aTarget){  // translate into an appropriate removehistory call  nsresult rv;  if ((aSource == kNC_HistoryRoot || aSource == kNC_HistoryByDate || IsFindResource(aSource)) &&      aProperty == kNC_child) {    nsCOMPtr<nsIRDFResource> resource = do_QueryInterface(aTarget, &rv);    if (NS_FAILED(rv)) return NS_RDF_ASSERTION_REJECTED;     const char* targetUrl;    rv = resource->GetValueConst(&targetUrl);    if (NS_FAILED(rv)) return NS_RDF_ASSERTION_REJECTED;    if (IsFindResource(resource)) {      // convert uri to a query      searchQuery query;      rv = FindUrlToSearchQuery(targetUrl, query);      if (NS_FAILED(rv)) return NS_RDF_ASSERTION_REJECTED;       matchQuery_t matchQuery;      matchQuery.history = this;      matchQuery.query = &query;      rv = RemoveMatchingRows(matchQueryCallback, (void*)&matchQuery, PR_TRUE);       FreeSearchQuery(query);      if (NS_FAILED(rv)) return NS_RDF_ASSERTION_REJECTED;      // if there are batches in progress, we don't want to notify      // observers that we're deleting items. the caller promises      // to handle whatever UI updating is necessary when we're finished.      if (!mBatchesInProgress)        NotifyUnassert(aSource, aProperty, aTarget);      return NS_OK;    }    // ignore any error    rv = RemovePage(targetUrl);    if (NS_FAILED(rv)) return NS_RDF_ASSERTION_REJECTED;    return NS_OK;  }    return NS_RDF_ASSERTION_REJECTED;}