Content Type Dependencies

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Content Type Dependencies

jeremy.ralegh
Hi,

a comment in nsIContentPolicy.idl says

  /* When adding new content types, please update nsContentBlocker,
   * NS_CP_ContentTypeName, contentScurityPolicy.js, all nsIContentPolicy
   * implementations, and other things that are not listed here that are
   * related to nsIContentPolicy. */

My first thought was that it should be enough to look for all files that #include nsIContentPolicy.h und rebuild the specific subtrees, but when I looked a second time at the comment I realized that this can't be everything.

What do I have to do after adding a new content type? I'd need a complete list of all the files I have to update and I'd need to know if there're any other changes I have to make inside other files.

Regards,
Jeremy
_______________________________________________
dev-security mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-security
Reply | Threaded
Open this post in threaded view
|

Re: Content Type Dependencies

jeremy.ralegh
Is this a dumb question? I just want to know, if I have to do a complete rebuild and if I need to change other files somehow.

Jeremy
_______________________________________________
dev-security mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-security
Reply | Threaded
Open this post in threaded view
|

Re: Content Type Dependencies

Boris Zbarsky
On 4/8/13 8:27 PM, [hidden email] wrote:
> Is this a dumb question? I just want to know, if I have to do a complete rebuild and if I need to change other files somehow.

If you're ever in doubt, do a complete rebuild.

-Boris

_______________________________________________
dev-security mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-security
Reply | Threaded
Open this post in threaded view
|

Re: Content Type Dependencies

Daniel Veditz-2
In reply to this post by jeremy.ralegh
On 4/5/2013 5:26 PM, [hidden email] wrote:
> a comment in nsIContentPolicy.idl says
>
> /* When adding new content types, [...]
>
> My first thought was that it should be enough to look for all files
> that #include nsIContentPolicy.h und rebuild the specific subtrees,

Note that nsIContentPolicy is a public contract and that lots of add-ons
use it -- you can never rebuild enough to know you haven't broken
anything. If Gecko starts doing some new behavior and we add a type it's
less likely to break these other uses, but if you create a new type to
cover part of an existing category you're more likely to create problems.

Not that it can't be done--we do it every once in a while--but you will
need to reach out and announce the impending changes more broadly than
the typical isolated new feature.

-Dan Veditz


_______________________________________________
dev-security mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-security
Reply | Threaded
Open this post in threaded view
|

Re: Content Type Dependencies

Brian Smith-31
Daniel Veditz wrote:

> On 4/5/2013 5:26 PM, [hidden email] wrote:
> > a comment in nsIContentPolicy.idl says
> >
> > /* When adding new content types, [...]
>
> Note that nsIContentPolicy is a public contract and that lots of
> add-ons use it -- you can never rebuild enough to know you haven't
> broken anything. If Gecko starts doing some new behavior and we add
> a type it's less likely to break these other uses, but if you
> create a new type to cover part of an existing category you're more
> likely to create problems.

Yes, we should avoid adding new types that are subsets of anything except TYPE_OTHER.

IIRC, I am the one that wrote the "When adding new content types" comment and I enumerated the places that need to be updated *that I was aware of at the time*. I wrote that comment because I was surprised at all the places that need to be updated, but I did so from a position of extreme ignorance as I was very new to nsIContentPolicy at that time. I am not super confident in how comprehensive that list of places is, unfortunately.

If you find a place that needs to be updated that I ommitted, please file a bug so that we can amend the documentation.

Cheers,
Brian
_______________________________________________
dev-security mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-security