Re: Add new "network channel about to connect" event to nsIObserverService?

Jonas Sicking <[email protected]> Fri, 10 Aug 2012 18:05:07 -0700
Newsgroups gmane.comp.mozilla.devel.netlib
Message-ID <CA+c2ei9F=+kqHbQt_ErthG=-Jd2cJs3fvKAc0e0D9ZHA=CwM7Q@mail.gmail.com>
I don't really have an opinion on this. But I should probably adjust
my CSP comment and say that it seems like a nasty hack to add non-CSP
policies to the CSP observers.

Of course, had we had bug 694101, this would probably have been much easier ;-)

/ Jonas

On Fri, Aug 10, 2012 at 3:49 PM, Jason Duell <[email protected]> wrote:
> In
>
>    https://bugzilla.mozilla.org/show_bug.cgi?id=780087
>
> we'll be blocking B2G app's traffic if they exceed a quota, and/or only
> allow it if the phone is in a wifi network, etc.
>
> Honza came up with the idea of adding a CSP policy to do this monitoring,
> but sicking comments on IRC that "putting it in the CSP code sounds like a
> scary hack though given that it's not CSP code at all".  So perhaps CSP is a
> bad place for it.
>
> We could use http-on-modify-request, but that only fires for HTTP requests.
>
> I'm currently thinking we might want to add a new nsIObserverService
> notification that's issued for "necko channel for app AppID about to connect
> on network interface FOO".   How does that sound?  Am I missing some other
> clever way of doing this?
>
> Jason
>