- From: Marcos Fábio Pereira <marcos.pereira@signove.com>
- Date: Wed, 29 Jul 2015 16:46:54 -0300
- To: Boris Zbarsky <bzbarsky@mit.edu>
- Cc: "public-device-apis@w3.org" <public-device-apis@w3.org>
Received on Wednesday, 29 July 2015 19:47:22 UTC
I think it is just to make it compliance with ES6 and most hardware implementation as possible. Maybe in the future some hardware implementation needs some time to retrieve the battery level and create the instance of BatteryManager in the first call of getBattery(). Br, Marcos 2015-07-29 14:27 GMT-03:00 Boris Zbarsky <bzbarsky@mit.edu>: > I was asked to review a patch to Gecko to align our implementation of the > battery API to http://www.w3.org/TR/2014/CR-battery-status-20141209/ and > I'm not sure I understand the intent of the Promise usage in that > specification. > > The Promise just returns a manager object; this doesn't particularly need > to be an async operation (though it can be one, of course). But all the > operations for querying the actual hardware state are then synchronous, and > _those_ are what I would expect one might want to do asynchronously. > > I looked through the list archives, but can't seem to find the rationale > for the current design; if there is one there, I would appreciate a pointer > to it. > > Thanks, > Boris > > -- ------------------------------------------------------------- Marcos Fábio Pereira
Received on Wednesday, 29 July 2015 19:47:22 UTC