Commit 4088495e authored by Mark Banner's avatar Mark Banner
Browse files

Bug 1795322 - Update toolkit modules references in places and storage code. r=mak

parent 97298a7f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -84,16 +84,16 @@ interface mozIStorageAsyncConnection : nsISupports {
   *    `createStatement("BEGIN").execute()` on a `mozIStorageConnection`.
   * 3. Executing an async statement, like
   *    `createAsyncStatement("BEGIN").executeAsync(...)`. This is what
   *    `Sqlite.jsm` does under the hood.
   *    `Sqlite.sys.mjs` does under the hood.
   *
   * Because of this, it's important *not* to use this attribute to decide
   * whether to *commit* the active transaction, because the caller that opened
   * it may not expect that. This is why both `mozStorageTransaction` and
   * `Sqlite.jsm` use an internal variable (`mHasTransaction` for the former;
   * `Sqlite.sys.mjs` use an internal variable (`mHasTransaction` for the former;
   * `_hasInProgressTransaction` for the latter) to check if their transaction
   * is already in progress, instead of just checking this attribute before
   * committing. Otherwise, mozStorage might accidentally commit (or roll back!)
   * a transaction started by `Sqlite.jsm`, and vice versa.
   * a transaction started by `Sqlite.sys.mjs`, and vice versa.
   */
  readonly attribute boolean transactionInProgress;

+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ impl Conn {
    /// error.
    ///
    /// Note that this is `true` even if the transaction was started by another
    /// caller, like `Sqlite.jsm` or `mozStorageTransaction` from C++. See the
    /// caller, like `Sqlite.sys.mjs` or `mozStorageTransaction` from C++. See the
    /// explanation above `mozIStorageConnection.transactionInProgress` for why
    /// this matters.
    pub fn transaction_in_progress(&self) -> Result<bool> {
+5 −5
Original line number Diff line number Diff line
@@ -3066,7 +3066,7 @@ function validateBookmarkObject(name, input, behavior) {
 * Updates frecency for a list of URLs.
 *
 * @param db
 *        the Sqlite.jsm connection handle.
 *        the Sqlite.sys.mjs connection handle.
 * @param urls
 *        the array of URLs to update.
 */
@@ -3097,7 +3097,7 @@ var updateFrecency = async function(db, urls) {
 * Removes any orphan annotation entries.
 *
 * @param db
 *        the Sqlite.jsm connection handle.
 *        the Sqlite.sys.mjs connection handle.
 */
var removeOrphanAnnotations = async function(db) {
  await db.executeCached(
@@ -3121,7 +3121,7 @@ var removeOrphanAnnotations = async function(db) {
 * Removes annotations for a given item.
 *
 * @param db
 *        the Sqlite.jsm connection handle.
 *        the Sqlite.sys.mjs connection handle.
 * @param items
 *        The items for which to remove annotations.
 */
@@ -3147,7 +3147,7 @@ var removeAnnotationsForItems = async function(db, items) {
 * Updates lastModified for all the ancestors of a given folder GUID.
 *
 * @param db
 *        the Sqlite.jsm connection handle.
 *        the Sqlite.sys.mjs connection handle.
 * @param folderGuid
 *        the GUID of the folder whose ancestors should be updated.
 * @param time
@@ -3196,7 +3196,7 @@ var setAncestorsLastModified = async function(
 * Remove all descendants of one or more bookmark folders.
 *
 * @param {Object} db
 *        the Sqlite.jsm connection handle.
 *        the Sqlite.sys.mjs connection handle.
 * @param {Array} folderGuids
 *        array of folder guids.
 * @return {Array}
+3 −3
Original line number Diff line number Diff line
@@ -592,7 +592,7 @@ const BookmarkSyncUtils = (PlacesSyncUtils.bookmarks = Object.freeze({
   *   remaining items to "NEW"; and don't wipe the server.
   *
   * @param db
   *        the Sqlite.jsm connection handle.
   *        the Sqlite.sys.mjs connection handle.
   * @param source
   *        the change source constant.
   */
@@ -1182,7 +1182,7 @@ const BookmarkSyncUtils = (PlacesSyncUtils.bookmarks = Object.freeze({
   * tag or keyword entry.
   *
   * @param db
   *        the Sqlite.jsm connection handle.
   *        the Sqlite.sys.mjs connection handle.
   * @param url
   *        the bookmark URL object.
   * @param syncChangeDelta
@@ -1848,7 +1848,7 @@ function addRowToChangeRecords(row, changeRecords) {
 * changeset for the Sync bookmarks engine.
 *
 * @param db
 *        The Sqlite.jsm connection handle.
 *        The Sqlite.sys.mjs connection handle.
 * @param forGuids
 *        Fetch Sync tracking information for only the requested GUIDs.
 * @return {Promise} resolved once all items have been fetched.
+8 −8
Original line number Diff line number Diff line
@@ -1454,7 +1454,7 @@ export var PlacesUtils = {
  },

  /**
   * Gets a shared Sqlite.jsm readonly connection to the Places database,
   * Gets a shared Sqlite.sys.mjs readonly connection to the Places database,
   * usable only for SELECT queries.
   *
   * This is intended to be used mostly internally, components outside of
@@ -1480,14 +1480,14 @@ export var PlacesUtils = {
  },

  /**
   * Returns a Sqlite.jsm wrapper for the main Places connection. Most callers
   * Returns a Sqlite.sys.mjs wrapper for the main Places connection. Most callers
   * should prefer `withConnectionWrapper`, which ensures that all database
   * operations finish before the connection is closed.
   */
  promiseUnsafeWritableDBConnection: () => lazy.gAsyncDBWrapperPromised,

  /**
   * Performs a read/write operation on the Places database through a Sqlite.jsm
   * Performs a read/write operation on the Places database through a Sqlite.sys.mjs
   * wrapped connection to the Places database.
   *
   * This is intended to be used only by Places itself, always use APIs if you
@@ -1509,7 +1509,7 @@ export var PlacesUtils = {
   *
   * @param {string} name The name of the operation. Used for debugging, logging
   *   and crash reporting.
   * @param {function(db)} task A function that takes as argument a Sqlite.jsm
   * @param {function(db)} task A function that takes as argument a Sqlite.sys.mjs
   *   connection and returns a Promise. Shutdown is guaranteed to not interrupt
   *   execution of `task`.
   */
@@ -2116,10 +2116,10 @@ function setupDbForShutdown(conn, name) {
            // database. We just need to close the high-level connection.
            try {
              await conn.close();
              state = "2. Closed Sqlite.jsm connection.";
              state = "2. Closed Sqlite.sys.mjs connection.";
              resolve();
            } catch (ex) {
              state = "2. Failed to closed Sqlite.jsm connection: " + ex;
              state = "2. Failed to closed Sqlite.sys.mjs connection: " + ex;
              reject(ex);
            }
          },
@@ -2132,10 +2132,10 @@ function setupDbForShutdown(conn, name) {
      }
    }).catch(Cu.reportError);

    // Make sure that Sqlite.jsm doesn't close until we are done
    // Make sure that Sqlite.sys.mjs doesn't close until we are done
    // with the high-level connection.
    lazy.Sqlite.shutdown.addBlocker(
      `${name} must be closed before Sqlite.jsm`,
      `${name} must be closed before Sqlite.sys.mjs`,
      () => promiseClosed,
      () => state
    );
Loading