Created attachment 586543 [details] [diff] [review]
I no longer have much faith left that outside developers will be able to correctly implement write barriers. So this patch moves the API to jsfriendapi.h, and also simplifies it somewhat.
I also changed the SetProto barrier on XPCWrappedNative. Previously, the barrier used the existing tracing code to trace the wrapped native's proto. Now it uses a special write barrier call instead. The reason to do this is that it doesn't require a JSTracer. Requiring the runtime to have a JSTracer for XPConnect barriers is troublesome because of thread safety issues.
Most of these are JSAPI changes for Luke. Also asking for Bobby's review of the XPConnect changes.