On 8/19/13 8:15 PM, Nicholas Nethercote wrote:
Unfortunately, this work will only go so far because
xpcpublic.h, BindingUtils.h, and DOMJSClass.h all (unavoidably)
include jsapi.h, and they are headers that are large and included in
lots of places.  I'd love to hear suggestions as to how they could be
broken into smaller pieces and/or included in fewer places.

DOMJSClass.h only needs various forward-declarations, mostly. The exceptions are:

1) It needs js::GetGlobalForObjectCrossCompartment (used in an inline method), but we could move that bit into some other header. The declaration of the inline method would need to stay here, but the definition could be somewhere else.

2) It needs the definition of JSClass, for a member of the DOMJSClass struct and the DOMIfaceAndProtoJSClass struct. Unfortunately, this is defined in jsapi.h and defining the DOMJSClass struct is the main point of this header file.

3) It needs js::GetReservedSlot for some inline functions, but we could put those in some other header.

BindingUtils.h we could try breaking up in various ways, but it should be very rare for _headers_ to include that file; for the most part such inclusions are a bug from my point of view. For non-headers that include it (e.g. binding implementation files), it might well be common to need jsapi.h.

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to