WebAPI/DataStore: Difference between revisions

Line 67: Line 67:
     // Returns the label of the DataSource.
     // Returns the label of the DataSource.
     readonly attribute DOMString name;
     readonly attribute DOMString name;
   
     // Returns the origin of the DataSource (e.g., 'facebook.com').
     // Returns the origin of the DataSource (e.g., 'facebook.com').
     // TODO: defines what the value should be if owned by 'system'.
     // This value is the manifest URL of the owner app.
     readonly attribute DOMString owner;
     readonly attribute DOMString owner;
   
     // is readOnly a F(current_app, datastore) function? yes
     // is readOnly a F(current_app, datastore) function? yes
     readonly attribute boolean readOnly;
     readonly attribute boolean readOnly;
     // TODO: id should be incremental.
      
     Future<Object>  get(int id);
     Promise<Object>  get(int id);
     Future<void>    update(int id, Object obj);
     Promise<void>    update(int id, Object obj);
     Future<int>    add(Object obj);
     Promise<int>    add(Object obj);
     Future<boolean> remove(int id);
     Promise<boolean> remove(int id);
     Future<void>    clear();
     Promise<void>    clear();
   
     readonly attribute DOMString revisionId;
     readonly attribute DOMString revisionId;
   
     attribute EventHandler onchange;
     attribute EventHandler onchange;
     Future<DataStoreChanges> getChanges(DOMString revisionId);
     Future<DataStoreChanges> getChanges(DOMString revisionId);
   
     // TODO: getAll(), getLength().
     // TODO: getAll(), getLength().
   };
   };
Line 90: Line 95:
     readonly attribute int[] removedIds;
     readonly attribute int[] removedIds;
   }
   }
 
 
   partial interface Navigator {
   partial interface Navigator {
     Future<sequence<DataStore>> getDataStores(DOMString name);
     Promise<sequence<DataStore>> getDataStores(DOMString name);
   };
   };


Confirmed users
53

edits