B2G/gecko/toolkit/components/places/tests/head_common.js
/**
 * Retrieves the guid for a given uri.
 *
 * @param aURI
 *        The uri to check.
 * @param [optional] aStack
 *        The stack frame used to report the error.
 * @return the associated the guid.
 */
Retrieves the guid for a given uri.
@param aURI
The uri to check.
@param [optional] aStack
The stack frame used to report the error.
@return the associated the guid.
Retrieves the guid for a given uri . @param aURI The uri to check . @param [ optional ] aStack The stack frame used to report the error . @return the associated the guid .
function do_get_guid_for_uri(aURI,
                             aStack)
{
  if (!aStack) {
    aStack = Components.stack.caller;
  }
  let stmt = DBConn().createStatement(
    "SELECT guid "
  + "FROM moz_places "
  + "WHERE url = :url "
  );
  stmt.params.url = aURI.spec;
  do_check_true(stmt.executeStep(), aStack);
  let guid = stmt.row.guid;
  stmt.finalize();
  do_check_valid_places_guid(guid, aStack);
  return guid;
}
function do_get_guid_for_uri ( aURI , aStack ) { if ( ! aStack ) { aStack = Components . stack . caller ; } let stmt = DBConn ( ) . createStatement ( "SELECT guid " + "FROM moz_places " + "WHERE url = :url " ) ; stmt . params . url = aURI . spec ; do_check_true ( stmt . executeStep ( ) , aStack ) ; let guid = stmt . row . guid ; stmt . finalize ( ) ; do_check_valid_places_guid ( guid , aStack ) ; return guid ; }
Retrieves the guid for a given uri.
Retrieves the guid for a given uri .