dom/webidl/IDBDatabase.webidl
author Edwin Takahashi <egao@mozilla.com>
Sat, 25 Jan 2020 03:05:42 +0000
changeset 511755 f7f534f08b4827c90ed4ec421c14355cb81dfaaa
parent 510238 4cb7eb44640213b7f290bf4de4cb75e381ba1398
permissions -rw-r--r--
Bug 1611340 - run mach doctor with python3 r=Callek Changes: Build string using the `format()` instead of `%` and relocate the `expandtabs` call to not trigger a AttributeError exception. Differential Revision: https://phabricator.services.mozilla.com/D60939

/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * The origin of this IDL file is
 * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBObjectStoreParameters
 *
 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
 * liability, trademark and document use rules apply.
 */

[Exposed=(Window,Worker)]
interface IDBDatabase : EventTarget {
    readonly    attribute DOMString          name;
    readonly    attribute unsigned long long version;

    readonly    attribute DOMStringList      objectStoreNames;

    [Throws]
    IDBObjectStore createObjectStore (DOMString name, optional IDBObjectStoreParameters optionalParameters = {});

    [Throws]
    void           deleteObjectStore (DOMString name);

    [Throws]
    IDBTransaction transaction ((DOMString or sequence<DOMString>) storeNames,
                                optional IDBTransactionMode mode = "readonly");

    void           close ();

                attribute EventHandler       onabort;
                attribute EventHandler       onclose;
                attribute EventHandler       onerror;
                attribute EventHandler       onversionchange;
};

partial interface IDBDatabase {
    [Func="mozilla::dom::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
    readonly    attribute StorageType        storage;

    [Exposed=Window, Throws, UseCounter]
    IDBRequest createMutableFile (DOMString name, optional DOMString type);
};