Hello guys,

I'm quite new to Gecko development, and approaching this bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=1050749

Started looking at Gecko source code and at the implementation of the old
navigator.battery:

https://github.com/mozilla/gecko-dev/blob/2f5bf545b602ff8a4e64e2257511f464ec35a934/dom/base/Navigator.cpp#L1339

I assumed that there's a "getter" convention when creating the interface:

https://github.com/mozilla/gecko-dev/blob/2f5bf545b602ff8a4e64e2257511f464ec35a934/dom/base/Navigator.h#L157

so that the javascript "navigator.battery" is exposed by Gecko with the
"battery::BatteryManager* GetBattery()" method, is it right?

The question is:

- how do I create a javascript "navigator.getBattery()" interface?

I noticed that the javascript "navigator.getUserMedia", which should be a
similar case, is prefixed:

void MozGetUserMedia() -
https://github.com/mozilla/gecko-dev/blob/2f5bf545b602ff8a4e64e2257511f464ec35a934/dom/base/Navigator.h#L264

How do you suggest to approach this?
Does the getBattery method has to be prefixed as well?

Thank you ;)

Francesco <http://www.francesco.iovine.name/>
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to