Hi Paul,
Thank you very much for your very detailed answer!
First of all I will explain my project so you can understand better what I want 
to do :)
My main goal is to log all privacy-related API requests (geolocation, contacts, 
etc..) and the apps that requested them, and show them in a Gaia app. The 
logging would be done from there, which is why I want to send the name of the 
app and the permission it requested to Gaia, so that this app can store it in 
IndexedDB.
>From the Gecko layer I would call my custom WebIDL from the different API's I 
>want to monitor. For example, for the Contacts API I do this:
https://github.com/spatenotte/gecko/blob/master/dom/contacts/ContactManager.js#L490
I call notifyListener(), which is a new method I defined in the same class, 
that would notify my WebIDL, which would send the message to Gaia.
The WebIDL implementation is in this folder:
https://github.com/spatenotte/gecko/tree/master/dom/privacymonitor
And the corresponding .webidl file:
https://github.com/spatenotte/gecko/blob/master/dom/webidl/PrivacyMonitor.webidl
I think the diagram of NFC you showed me looks promising, I actually thought 
about registering a custom event handler, similar to "onPeerReady" and 
"onPeerLost" for NFC, but haven't fully understood it yet and was looking for a 
simpler solution :)
As for the Engineering mode API, I don't really understand how it can help me, 
as far as I understand you have to call it manually from the Gaia app to 
receive the message, but in my case we can't do that since we don't know when a 
message (API request) will arrive.

Best,
Sammy.
_______________________________________________
dev-fxos mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-fxos

Reply via email to