\o/

+1 on the UML diagram!  This helps out for testing as well.  :)

Regards,
Naoki

On Mar 20, 2015, at 4:16 AM, Ethan Tseng <etts...@mozilla.com> wrote:

> Hi John,
> 
> Hope it's not too late to answer your question.
> 
> This is an UML class diagram that gives you a whole picture of NetworkStats 
> architecture.
> https://wiki.mozilla.org/images/3/3e/NetworkStats_Architecture.svg
> 
> The current design of NetworkStatsService exposes API for other XPCOM 
> components to save network statistics (saveAppStats), but does not provide 
> convenient interface to get statistics. Because the original requirement is 
> to expose getting statistics by Web APIs (MozNetworkStatsManager).
> 
> Could you elaborate your purpose of using NetworkStatsManager.getSamples() in 
> Gecko?
> We might come up with better solution if we have more detail of use cases. :)
> 
> Best Regards,
> 
> 
> 
> Ethan Tseng
> Senior Software Engineer of Mozilla
> 
> On Sat, Mar 14, 2015 at 3:22 AM, <johnlzel...@gmail.com> wrote:
> Hello b2g!
> 
> I am attempting to access NetworkStatsManager.getSamples() from within my own 
> XPCOM component. Here is my current code: 
> https://zeller.pastebin.mozilla.org/8825742
> 
> On line 162, the function isNowGood() will be the only thing exposed to web 
> content. I need access to NetworkStatsManager.getSamples(), specifically to 
> get the rx/tx data history for the device.
> 
> The problem is that I am not sure how to do this. Speaking with fabrice in 
> #b2g today, he advised me that I should use my own parent side module, and 
> talk to other parent side modules.
> 
> I am new to the parent/child abstraction in Gecko, so I am not 100% how to 
> proceed here. Previous advice I received suggested that I use IPC via 
> cpmm.sendAsyncMessage, which you will see on line 108 in my code above.
> 
> So what are the next steps here? I am not sure how to go about achieving this 
> messaging.
> 
> Is code running from my init function considered to be running in my own 
> parent side module? Is NetworkStatsManager.js the code running in the other 
> parent side module I am seeking to achieve this?
> 
> Forgive the novice-y questions, I am trying desperately to wrap my head 
> around this.
> _______________________________________________
> dev-b2g mailing list
> dev-b2g@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-b2g
> 
> _______________________________________________
> dev-b2g mailing list
> dev-b2g@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-b2g

_______________________________________________
dev-b2g mailing list
dev-b2g@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to