B2G/gecko/toolkit/components/places/tests/head_common.js
/**
 * Returns the frecency of a url.
 *
 * @param aURI
 *        The URI or spec to get frecency for.
 * @return the frecency value.
 */
Returns the frecency of a url.
@param aURI
The URI or spec to get frecency for.
@return the frecency value.
Returns the frecency of a url . @param aURI The URI or spec to get frecency for . @return the frecency value .
function frecencyForUrl(aURI)
{
  let url = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
  let stmt = DBConn().createStatement(
    "SELECT frecency FROM moz_places WHERE url = ?1"
  );
  stmt.bindByIndex(0, url);
  if (!stmt.executeStep())
    throw new Error("No result for frecency.");
  let frecency = stmt.getInt32(0);
  stmt.finalize();
  return frecency;
}
function frecencyForUrl ( aURI ) { let url = aURI instanceof Ci . nsIURI ? aURI . spec : aURI ; let stmt = DBConn ( ) . createStatement ( "SELECT frecency FROM moz_places WHERE url = ?1" ) ; stmt . bindByIndex ( 0 , url ) ; if ( ! stmt . executeStep ( ) ) throw new Error ( "No result for frecency." ) ; let frecency = stmt . getInt32 ( 0 ) ; stmt . finalize ( ) ; return frecency ; }
Returns the frecency of a url.
Returns the frecency of a url .