gecko-dev/js/xpconnect
Andrew McCreight 821b59184e Bug 1288817, part 1 - Make XPCNativeScriptableShared refcounted. r=billm
This adds a heap allocation in
XPCNativeScriptableSharedMap::GetNewOrUsed() on the fast
path. Hopefully that code is not hot enough for it to matter. I could
work around this if needed, but it would be ugly.

mNativeScriptableSharedMap has a weak pointer to
XPCNativeScriptableShared. I moved this removal from
XPCJSRuntime::FinalizeCallback() to the dtor.

There are two types of scriptable: one is a dummy one created in
GetNewOrUsed() to do a lookup, and the other is a fully filled out
one. The dummy one is not added to the hashtable, and may have had its
name stolen if we created a new scriptable. The latter makes it so
that you crash if you try to look it up in the hashtable anyways, so
this patch only looks up fully filled out scriptables.

This patch also removes MOZ_COUNT_CTOR/DTOR because they are not
needed for refcounted classes.

Stop destroying mScriptableInfo in XPCWrappedNative's
SystemIsBeingShutDown(), because that will end up destroying
XPCNativeScriptableShared, while their js::ClassOps are still in use
by JS objects. This matches the existing behavior, which does not
sweep these ScriptableShared during shutdown. (This came up in opt
xpcshell tests.)

MozReview-Commit-ID: GeG0pAYqXpR
2016-08-16 14:29:51 -07:00
..
crashtests Bug 1288791 part 2. Rename WrapNativeParent to FindAssociatedGlobal and update it to actually do that. r=bkelly 2016-07-27 11:05:36 -04:00
idl Bug 1282150 part 6. Get rid of GetSafeJSContext. r=bholley 2016-07-07 20:08:26 -04:00
loader Bug 1292892 part 5 - Replace most nsContentUtils::RootingCx calls with dom::RootingCx. r=bz,terrence 2016-08-11 14:39:23 +02:00
public Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
shell Bug 1285356: Fix blocklist initialization regressions; r=bsmedberg 2016-07-07 17:00:23 -06:00
src Bug 1288817, part 1 - Make XPCNativeScriptableShared refcounted. r=billm 2016-08-16 14:29:51 -07:00
tests Backed out changeset 3fbb8651a171 (bug 1121938) for breaking encrypted-media-syntax.html CLOSED TREE 2016-08-10 13:17:39 -07:00
wrappers Bug 1292289, part 1 - Stop unnecessarily using xpcprivate in XPCWrapper.h. r=mrbkap 2016-08-04 11:14:35 -07:00
moz.build Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00