1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/DataStoreImpl.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,68 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + */ 1.9 + 1.10 +// TODO Bug 957086 - The DataStoreImpl WebIDL will be removed once the 1.11 +// DataStore API is fully rewritten in C++ (i.e. should be 1.12 +// directly implemented by the DataStore WebIDL). 1.13 + 1.14 +[HeaderFile="mozilla/dom/DataStore.h", 1.15 + Func="mozilla::dom::DataStore::EnabledForScope", 1.16 + JSImplementation="@mozilla.org/dom/datastore-impl;1"] 1.17 +interface DataStoreImpl { 1.18 + void setEventTarget(EventTarget eventTarget); 1.19 + 1.20 + // Returns the label of the DataSource. 1.21 + readonly attribute DOMString name; 1.22 + 1.23 + // Returns the origin of the DataSource (e.g., 'facebook.com'). 1.24 + // This value is the manifest URL of the owner app. 1.25 + readonly attribute DOMString owner; 1.26 + 1.27 + // is readOnly a F(current_app, datastore) function? yes 1.28 + readonly attribute boolean readOnly; 1.29 + 1.30 + // Promise<any> 1.31 + Promise get(DataStoreKey... id); 1.32 + 1.33 + // Promise<void> 1.34 + Promise put(any obj, DataStoreKey id, optional DOMString revisionId = ""); 1.35 + 1.36 + // Promise<DataStoreKey> 1.37 + Promise add(any obj, optional DataStoreKey id, 1.38 + optional DOMString revisionId = ""); 1.39 + 1.40 + // Promise<boolean> 1.41 + Promise remove(DataStoreKey id, optional DOMString revisionId = ""); 1.42 + 1.43 + // Promise<void> 1.44 + Promise clear(optional DOMString revisionId = ""); 1.45 + 1.46 + readonly attribute DOMString revisionId; 1.47 + 1.48 + // Promise<unsigned long> 1.49 + Promise getLength(); 1.50 + 1.51 + [NewObject] 1.52 + DataStoreCursor sync(optional DOMString revisionId = ""); 1.53 +}; 1.54 + 1.55 + 1.56 +// TODO Bug 957086 - The DataStoreCursorImpl WebIDL will be removed once the 1.57 +// DataStore API is fully rewritten in C++ (i.e. should be 1.58 +// directly implemented by the DataStoreCursor WebIDL). 1.59 + 1.60 +[HeaderFile="mozilla/dom/DataStore.h", 1.61 + Func="mozilla::dom::DataStore::EnabledForScope", 1.62 + JSImplementation="@mozilla.org/dom/datastore-cursor-impl;1"] 1.63 +interface DataStoreCursorImpl { 1.64 + // the DataStore 1.65 + readonly attribute DataStore store; 1.66 + 1.67 + // Promise<DataStoreTask> 1.68 + Promise next(); 1.69 + 1.70 + void close(); 1.71 +};