зеркало из https://github.com/mozilla/gecko-dev.git
Bug 979586 - Part 1: Add missing SameObject/NewObject extattrs to IDB interfaces r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D134554
This commit is contained in:
Родитель
4ca5dc8689
Коммит
91dd83f2a6
|
@ -4,7 +4,7 @@
|
|||
* 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-IDBCursorDirection
|
||||
* https://w3c.github.io/IndexedDB/#cursor-interface
|
||||
*/
|
||||
|
||||
enum IDBCursorDirection {
|
||||
|
@ -27,10 +27,7 @@ interface IDBCursor {
|
|||
[Throws]
|
||||
readonly attribute any primaryKey;
|
||||
|
||||
readonly attribute IDBRequest request;
|
||||
|
||||
[Throws]
|
||||
IDBRequest update (any value);
|
||||
[SameObject] readonly attribute IDBRequest request;
|
||||
|
||||
[Throws]
|
||||
void advance ([EnforceRange] unsigned long count);
|
||||
|
@ -41,8 +38,8 @@ interface IDBCursor {
|
|||
[Throws]
|
||||
void continuePrimaryKey(any key, any primaryKey);
|
||||
|
||||
[Throws]
|
||||
IDBRequest delete ();
|
||||
[NewObject, Throws] IDBRequest update(any value);
|
||||
[NewObject, Throws] IDBRequest delete();
|
||||
};
|
||||
|
||||
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 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
|
||||
* https://w3c.github.io/IndexedDB/#database-interface
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
|
@ -17,16 +17,15 @@ interface IDBDatabase : EventTarget {
|
|||
|
||||
readonly attribute DOMStringList objectStoreNames;
|
||||
|
||||
[Throws]
|
||||
IDBObjectStore createObjectStore (DOMString name, optional IDBObjectStoreParameters optionalParameters = {});
|
||||
|
||||
[NewObject, Throws]
|
||||
IDBTransaction transaction((DOMString or sequence<DOMString>) storeNames,
|
||||
optional IDBTransactionMode mode = "readonly");
|
||||
[NewObject, Throws]
|
||||
IDBObjectStore createObjectStore(
|
||||
DOMString name,
|
||||
optional IDBObjectStoreParameters options = {});
|
||||
[Throws]
|
||||
void deleteObjectStore (DOMString name);
|
||||
|
||||
[Throws]
|
||||
IDBTransaction transaction ((DOMString or sequence<DOMString>) storeNames,
|
||||
optional IDBTransactionMode mode = "readonly");
|
||||
|
||||
void close ();
|
||||
|
||||
attribute EventHandler onabort;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 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-IDBFactory
|
||||
* https://w3c.github.io/IndexedDB/#factory-interface
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
|
@ -19,22 +19,22 @@ dictionary IDBOpenDBOptions
|
|||
|
||||
/**
|
||||
* Interface that defines the indexedDB property on a window. See
|
||||
* http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBFactory
|
||||
* https://w3c.github.io/IndexedDB/#idbfactory
|
||||
* for more information.
|
||||
*/
|
||||
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
|
||||
interface IDBFactory {
|
||||
[Throws, NeedsCallerType]
|
||||
[NewObject, Throws, NeedsCallerType]
|
||||
IDBOpenDBRequest
|
||||
open(DOMString name,
|
||||
[EnforceRange] unsigned long long version);
|
||||
|
||||
[Throws, NeedsCallerType]
|
||||
[NewObject, Throws, NeedsCallerType]
|
||||
IDBOpenDBRequest
|
||||
open(DOMString name,
|
||||
optional IDBOpenDBOptions options = {});
|
||||
|
||||
[Throws, NeedsCallerType]
|
||||
[NewObject, Throws, NeedsCallerType]
|
||||
IDBOpenDBRequest
|
||||
deleteDatabase(DOMString name,
|
||||
optional IDBOpenDBOptions options = {});
|
||||
|
@ -44,19 +44,19 @@ interface IDBFactory {
|
|||
cmp(any first,
|
||||
any second);
|
||||
|
||||
[Throws, ChromeOnly, NeedsCallerType]
|
||||
[NewObject, Throws, ChromeOnly, NeedsCallerType]
|
||||
IDBOpenDBRequest
|
||||
openForPrincipal(Principal principal,
|
||||
DOMString name,
|
||||
[EnforceRange] unsigned long long version);
|
||||
|
||||
[Throws, ChromeOnly, NeedsCallerType]
|
||||
[NewObject, Throws, ChromeOnly, NeedsCallerType]
|
||||
IDBOpenDBRequest
|
||||
openForPrincipal(Principal principal,
|
||||
DOMString name,
|
||||
optional IDBOpenDBOptions options = {});
|
||||
|
||||
[Throws, ChromeOnly, NeedsCallerType]
|
||||
[NewObject, Throws, ChromeOnly, NeedsCallerType]
|
||||
IDBOpenDBRequest
|
||||
deleteForPrincipal(Principal principal,
|
||||
DOMString name,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 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-IDBIndexParameters
|
||||
* https://w3c.github.io/IndexedDB/#index-interface
|
||||
*/
|
||||
|
||||
dictionary IDBIndexParameters {
|
||||
|
@ -20,10 +20,8 @@ dictionary IDBIndexParameters {
|
|||
|
||||
[Exposed=(Window,Worker)]
|
||||
interface IDBIndex {
|
||||
[SetterThrows]
|
||||
attribute DOMString name;
|
||||
|
||||
readonly attribute IDBObjectStore objectStore;
|
||||
[SetterThrows] attribute DOMString name;
|
||||
[SameObject] readonly attribute IDBObjectStore objectStore;
|
||||
|
||||
[Throws]
|
||||
readonly attribute any keyPath;
|
||||
|
@ -40,29 +38,26 @@ interface IDBIndex {
|
|||
[Pref="dom.indexedDB.experimental"]
|
||||
readonly attribute boolean isAutoLocale;
|
||||
|
||||
[Throws]
|
||||
IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next");
|
||||
[NewObject, Throws] IDBRequest get(any query);
|
||||
[NewObject, Throws] IDBRequest getKey(any query);
|
||||
|
||||
[Throws]
|
||||
IDBRequest openKeyCursor (optional any range, optional IDBCursorDirection direction = "next");
|
||||
|
||||
[Throws]
|
||||
IDBRequest get (any key);
|
||||
|
||||
[Throws]
|
||||
IDBRequest getKey (any key);
|
||||
|
||||
[Throws]
|
||||
IDBRequest count (optional any key);
|
||||
};
|
||||
|
||||
partial interface IDBIndex {
|
||||
// If we decide to add use counters for the mozGetAll/mozGetAllKeys
|
||||
// functions, we'll need to pull them out into sepatate operations
|
||||
// with a BinaryName mapping to the same underlying implementation.
|
||||
[Throws, Alias="mozGetAll"]
|
||||
IDBRequest getAll (optional any key, optional [EnforceRange] unsigned long limit);
|
||||
// See also bug 1577227.
|
||||
[NewObject, Throws, Alias="mozGetAll"]
|
||||
IDBRequest getAll(optional any query,
|
||||
optional [EnforceRange] unsigned long count);
|
||||
[NewObject, Throws, Alias="mozGetAllKeys"]
|
||||
IDBRequest getAllKeys(optional any query,
|
||||
optional [EnforceRange] unsigned long count);
|
||||
|
||||
[Throws, Alias="mozGetAllKeys"]
|
||||
IDBRequest getAllKeys (optional any key, optional [EnforceRange] unsigned long limit);
|
||||
[NewObject, Throws] IDBRequest count(optional any query);
|
||||
|
||||
[NewObject, Throws]
|
||||
IDBRequest openCursor(optional any query,
|
||||
optional IDBCursorDirection direction = "next");
|
||||
[NewObject, Throws]
|
||||
IDBRequest openKeyCursor(optional any query,
|
||||
optional IDBCursorDirection direction = "next");
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* 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
|
||||
* https://w3c.github.io/IndexedDB/#keyrange
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 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-IDBObjectStore
|
||||
* https://w3c.github.io/IndexedDB/#object-store-interface
|
||||
*/
|
||||
|
||||
dictionary IDBObjectStoreParameters {
|
||||
|
@ -21,31 +21,42 @@ interface IDBObjectStore {
|
|||
readonly attribute any keyPath;
|
||||
|
||||
readonly attribute DOMStringList indexNames;
|
||||
readonly attribute IDBTransaction transaction;
|
||||
[SameObject] readonly attribute IDBTransaction transaction;
|
||||
readonly attribute boolean autoIncrement;
|
||||
|
||||
[Throws]
|
||||
[NewObject, Throws]
|
||||
IDBRequest put (any value, optional any key);
|
||||
|
||||
[Throws]
|
||||
[NewObject, Throws]
|
||||
IDBRequest add (any value, optional any key);
|
||||
|
||||
[Throws]
|
||||
[NewObject, Throws]
|
||||
IDBRequest delete (any key);
|
||||
|
||||
[Throws]
|
||||
[NewObject, Throws]
|
||||
IDBRequest clear ();
|
||||
[NewObject, Throws]
|
||||
IDBRequest get (any key);
|
||||
|
||||
[Throws]
|
||||
[NewObject, Throws]
|
||||
IDBRequest getKey (any key);
|
||||
|
||||
[Throws]
|
||||
IDBRequest clear ();
|
||||
// Success fires IDBTransactionEvent, result == array of values for given keys
|
||||
// If we decide to add use a counter for the mozGetAll function, we'll need
|
||||
// to pull it out into a sepatate operation with a BinaryName mapping to the
|
||||
// same underlying implementation.
|
||||
[NewObject, Throws, Alias="mozGetAll"]
|
||||
IDBRequest getAll(optional any query,
|
||||
optional [EnforceRange] unsigned long count);
|
||||
[NewObject, Throws]
|
||||
IDBRequest getAllKeys(optional any query,
|
||||
optional [EnforceRange] unsigned long count);
|
||||
|
||||
[Throws]
|
||||
[NewObject, Throws]
|
||||
IDBRequest count(optional any key);
|
||||
|
||||
[NewObject, Throws]
|
||||
IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next");
|
||||
|
||||
[Throws]
|
||||
[NewObject, Throws]
|
||||
IDBRequest openKeyCursor(optional any query,
|
||||
optional IDBCursorDirection direction = "next");
|
||||
[NewObject, Throws]
|
||||
IDBIndex createIndex (DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters optionalParameters = {});
|
||||
|
||||
[Throws]
|
||||
|
@ -53,22 +64,5 @@ interface IDBObjectStore {
|
|||
|
||||
[Throws]
|
||||
void deleteIndex (DOMString indexName);
|
||||
|
||||
[Throws]
|
||||
IDBRequest count (optional any key);
|
||||
};
|
||||
|
||||
partial interface IDBObjectStore {
|
||||
// Success fires IDBTransactionEvent, result == array of values for given keys
|
||||
// If we decide to add use a counter for the mozGetAll function, we'll need
|
||||
// to pull it out into a sepatate operation with a BinaryName mapping to the
|
||||
// same underlying implementation.
|
||||
[Throws, Alias="mozGetAll"]
|
||||
IDBRequest getAll (optional any key, optional [EnforceRange] unsigned long limit);
|
||||
|
||||
[Throws]
|
||||
IDBRequest getAllKeys (optional any key, optional [EnforceRange] unsigned long limit);
|
||||
|
||||
[Throws]
|
||||
IDBRequest openKeyCursor (optional any range, optional IDBCursorDirection direction = "next");
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 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-IDBOpenDBRequest
|
||||
* https://w3c.github.io/IndexedDB/#idbopendbrequest
|
||||
*/
|
||||
|
||||
[Exposed=(Window,Worker), Func="IDBFactory::IsEnabled"]
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* 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-IDBRequest
|
||||
* https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBRequestReadyState
|
||||
* https://w3c.github.io/IndexedDB/#idbrequest
|
||||
* https://w3c.github.io/IndexedDB/#enumdef-idbrequestreadystate
|
||||
*/
|
||||
|
||||
enum IDBRequestReadyState {
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* 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-IDBTransaction
|
||||
* https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBTransactionMode
|
||||
* https://w3c.github.io/IndexedDB/#idbtransaction
|
||||
* https://w3c.github.io/IndexedDB/#enumdef-idbtransactionmode
|
||||
*/
|
||||
|
||||
enum IDBTransactionMode {
|
||||
|
@ -23,7 +23,7 @@ enum IDBTransactionMode {
|
|||
interface IDBTransaction : EventTarget {
|
||||
[Throws]
|
||||
readonly attribute IDBTransactionMode mode;
|
||||
readonly attribute IDBDatabase db;
|
||||
[SameObject] readonly attribute IDBDatabase db;
|
||||
|
||||
readonly attribute DOMException? error;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче