WebAPI/ProposedDeviceStorageAPIWithNotifications: Difference between revisions

no edit summary
No edit summary
Line 37: Line 37:
   // Create a watcher which will call the callback function every time files are updated
   // Create a watcher which will call the callback function every time files are updated
   // callback will take the DeviceStorage, the file's name, and the update type, which will be one of "created", "deleted", or "modified"
   // callback will take the DeviceStorage, the file's name, and the update type, which will be one of "created", "deleted", or "modified"
   // If filter is passed, the watcher will only return
   boolean addFileWatcher(Function callback);
  // If time is passed, the watcher will immediately call callback on each request which occurred since the given time.
  // The time is measured in milliseconds since Midnight GMT (00:00), January 1st, 1970.
  // returns a DOMRequest whose .result is a PRUint32 specifying a unique ID for the added watcher.
  DOMRequest addFileWatcher(Function callback, optional DOMString filter, optional PRInt64 time);
   
   
   // returns true if there was a watcher with this id, and false otherwise.
   // returns true if there was a watcher with this id, and false otherwise.
   boolean removeFileWatcher(PRUint32 id);
   boolean removeFileWatcher(Function callback);
   
   
   // See interface below for how to use this
   // See interface below for how to use this
22

edits