Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  SimpleDBUtils.sys.mjs   Sprache: unbekannt

 
Untersuchungsergebnis.mjs Download desUnknown {[0] [0] [0]}

/**
 * Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/
 */

import { RequestError } from "resource://testing-common/dom/quota/test/modules/RequestError.sys.mjs";

export const SimpleDBUtils = {
  createConnection(principal) {
    const connection = Cc["@mozilla.org/dom/sdb-connection;1"].createInstance(
      Ci.nsISDBConnection
    );

    connection.init(principal);

    return connection;
  },

  /**
   * Handles the completion of a request, awaiting the callback to be called
   * before proceeding.
   *
   * This function is designed to handle requests of the type `nsISDBRequest`
   *
   * These requests are typically returned by the connection.
   *
   * @param {object} request
   *   The request object, which must have a callback property and
   *   result-related properties (e.g., resultCode, resultName).
   * @returns {Promise}
   *   Resolves with the request's result when the operation is successful.
   * @throws {RequestError}
   *   If the request's resultCode is not `Cr.NS_OK`, indicating an error in
   *   the request.
   */
  async requestFinished(request) {
    await new Promise(function (resolve) {
      request.callback = function () {
        resolve();
      };
    });

    if (request.resultCode !== Cr.NS_OK) {
      throw new RequestError(request.resultCode, request.resultName);
    }

    return request.result;
  },
};

[Dauer der Verarbeitung: 0.29 Sekunden, vorverarbeitet 2026-08-27]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=476070
#Domains=661743