W3C home > Mailing lists > Public > public-device-apis@w3.org > July 2014

Re: [battery] Should getBattery() always return the same promise?

From: Marcos <marcos@marcosc.com>
Date: Fri, 4 Jul 2014 17:07:29 -0400
To: Tim Volodine <timvolodine@google.com>, Domenic Denicola <domenic@domenicdenicola.com>, Rick Waldron <waldron.rick@gmail.com>
Cc: Mounir Lamouri <mounir@lamouri.fr>, public-device-apis <public-device-apis@w3.org>
Message-ID: <etPan.53b71792.66334873.10b95@Marcoss-MacBook-Pro.local>


On July 4, 2014 at 3:27:41 PM, Domenic Denicola (domenic@domenicdenicola.com) wrote:
> > Rick, Chromium has a multi-process architecture, whereas  
> Firefox in general keeps most things in a single process. Thus  
> Firefox has the ability to implement many more things synchronously  
> than Chromium does. Implementation experience based on a single  
> vendor is not terribly valuable in guiding API surface, especially  
> in questions of sync vs. async, and especially when that vendor  
> is Firefox (the only single-process modern browser, from what  
> I understand).

Can't we just add `readonly attribute Promise isReady` (yes, we can bikeshed) to the current interface? That should can serve as a signal without needing to change the existing API (and can continue to work as it does today in Gecko without needing the API to be refactored).  

so:

navigator.battery.isReady.then(doFunThings)




-- 
Marcos Caceres
Received on Friday, 4 July 2014 21:07:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:33:10 UTC