_______________________________________________
dev-webapi mailing list
dev-w...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-webapi
Just curious, would this be a non-issue if we stored more information than just a boolean? What if we stored additional information say, in JSON? Have we thought about using datastore?
I think the problem is the race. You won’t know how long the datastore/settings db will callback, and the callback from enabling to enabled really does not mean navigator.HARDWARE.status is ‘enabled’ because the database operation is async and anything could happen during the database observer operation.
But if the hardware API has status change event we could make sure we always have the correct status in the callback.
於 2014年12月30日 於 下午12:18:26, Kevin Grandon (kgra...@mozilla.com) 寫:Just curious, would this be a non-issue if we stored more information than just a boolean? What if we stored additional information say, in JSON? Have we thought about using datastore?I think the problem is the race. You won’t know how long the datastore/settings db will callback, and the callback from enabling to enabled really does not mean navigator.HARDWARE.status is ‘enabled’ because the database operation is async and anything could happen during the database observer operation.
But if the hardware API has status change event we could make sure we always have the correct status in the callback.
As we've seen in the past moving stuff into gecko can be a slippery slope, so we should definitely think this out thoroughly. In any case, it seems that this might create a more friendly API for third party developers, so a +1 from me on that front.
It does seem like a *lot* of work though. I think it'd be worth while to do an initial investigation on both a platform fix and a different store in gaia to make sure we invest our time wisely.
Best,
Kevin
Tim
_______________________________________________
dev-webapi mailing list
dev-w...@lists.mozilla.org