Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Content Type Dependencies

18 views
Skip to first unread message

jeremy...@gmx.ch

unread,
Apr 5, 2013, 8:26:32 PM4/5/13
to
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

jeremy...@gmx.ch

unread,
Apr 8, 2013, 8:27:09 PM4/8/13
to
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

Boris Zbarsky

unread,
Apr 8, 2013, 10:14:23 PM4/8/13
to mozilla-de...@lists.mozilla.org
On 4/8/13 8:27 PM, jeremy...@gmx.ch 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

Daniel Veditz

unread,
Apr 9, 2013, 6:00:17 PM4/9/13
to jeremy...@gmx.ch, dev-se...@lists.mozilla.org
On 4/5/2013 5:26 PM, jeremy...@gmx.ch 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

Brian Smith

unread,
Apr 15, 2013, 4:43:35 PM4/15/13
to Daniel Veditz, jeremy ralegh, dev-se...@lists.mozilla.org
Daniel Veditz wrote:
> On 4/5/2013 5:26 PM, jeremy...@gmx.ch 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
0 new messages