PSA: Upcoming changes to the creation of Necko channels

Ehsan Akhgari ehsan.akhgari at gmail.com
Fri Apr 3 02:27:28 UTC 2015


Next week, I'm planning to land the patches to bug 1149853 which enables 
Gecko to track which RequestContext [1] a network fetch is being 
performed for.

This will enable us to correctly signal the context for which a given 
request was made to service workers that intercept the corrresponding 
network connection.

This requires modifying the C++ and JS APIs for creating Necko channels. 
  The changes to the callers is straightforward, you pass the value that 
describes the kind of network request you're making (for example, 
whether it's being used for an image, a stylesheet, or loading an 
iframe, etc.) in the form of a member of the 
mozilla::dom::RequestContext enum, or a string from the WebIDL enum. 
Note that for the network connections that are used for our own purposes 
which do not belong to a specific web page, this value won't be used, so 
its value doesn't matter in practice, but as convention, please pass 
RequestContext::Internal/"internal".

(Note to comm-central maintainers: unfortunately I won't have the time 
to look into the comm-central consumers for this one, since the fixes 
especially to JS code will require manual testing, it would be great if 
you can start with applying my patches on mozilla/ and update the 
comm-central consumers.  For comm-central, you can always use the 
"internal" value.)

Cheers,
Ehsan

[1] https://fetch.spec.whatwg.org/#requestcontext



More information about the tb-planning mailing list