On 4/6/15 1:21 PM, Ehsan Akhgari wrote:
Based on this many-to-many mapping
Yeah, that fact that RequestContext stuff is both more _and_ less
fine-grained than nsIContentPolicy is a PITA.
So we could still consider doing something like this:
1) Extend the set of nsIContentPolicy types such that there is a
many-to-one mapping from them to both the current nsIContentPolicy types
and the RequestContext types. So in particular, we'd have "toplevel
meta refresh", "frame meta refresh", "iframe meta refresh" as
nsIContentPolicy types.
2) Just pass in an nsIContentPolicy type.
3) Do the many-to-one mapping to derive the RequestContext type.
4) Do the many-to-one mapping to the current set of nsIContentPolicy
types before calling into nsIContentPolicy implementations.
This way all of "normal frame load", "iframe meta refresh", "normal
frame load", "iframe meta refresh" will map to TYPE_SUBDOCUMENT as far
as current API consumers are concerned.
The big drawback here is that any time we have this many-to-many mapping
we get a combinatorial explosion of nsIContentPolicy types to express
it... I'm OK with that if we don't expect it to happen much, I guess.
-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform