B2G/gecko/toolkit/components/places/tests/head_common.js
/**
 * Checks how many visits exist for a specified page.
 * @param aURI
 *        nsIURI or address to look for.
 * @return number of visits found.
 */
Checks how many visits exist for a specified page.
@param aURI
nsIURI or address to look for.
@return number of visits found.
Checks how many visits exist for a specified page . @param aURI nsIURI or address to look for . @return number of visits found .
function visits_in_database(aURI)
{
  let url = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
  let stmt = DBConn().createStatement(
    "SELECT count(*) FROM moz_historyvisits v "
  + "JOIN moz_places h ON h.id = v.place_id "
  + "WHERE url = :url"
  );
  stmt.params.url = url;
  try {
    if (!stmt.executeStep())
      return 0;
    return stmt.getInt64(0);
  }
  finally {
    stmt.finalize();
  }
}
function visits_in_database ( aURI ) { let url = aURI instanceof Ci . nsIURI ? aURI . spec : aURI ; let stmt = DBConn ( ) . createStatement ( "SELECT count(*) FROM moz_historyvisits v " + "JOIN moz_places h ON h.id = v.place_id " + "WHERE url = :url" ) ; stmt . params . url = url ; try { if ( ! stmt . executeStep ( ) ) return 0 ; return stmt . getInt64 ( 0 ) ; } finally { stmt . finalize ( ) ; } }
Checks how many visits exist for a specified page.
Checks how many visits exist for a specified page .