Bug 827471 - Improve CanSkipWrappedJS, r=mccr8

This commit is contained in:
Olli Pettay 2013-01-08 19:40:35 +02:00
Родитель 48e6c94542
Коммит 637ddf820c
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -431,11 +431,12 @@ CanSkipWrappedJS(nsXPCWrappedJS *wrappedJS)
// If traversing wrappedJS wouldn't release it, nor
// cause any other objects to be added to the graph, no
// need to add it to the graph at all.
bool isRootWrappedJS = wrappedJS->GetRootWrapper() == wrappedJS;
if (nsCCUncollectableMarker::sGeneration &&
(!obj || !xpc_IsGrayGCThing(obj)) &&
!wrappedJS->IsSubjectToFinalization() &&
wrappedJS->GetRootWrapper() == wrappedJS) {
if (!wrappedJS->IsAggregatedToNative()) {
(isRootWrappedJS || CanSkipWrappedJS(wrappedJS->GetRootWrapper()))) {
if (!wrappedJS->IsAggregatedToNative() || !isRootWrappedJS) {
return true;
} else {
nsISupports* agg = wrappedJS->GetAggregatedNativeObject();