зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 40c187d91db4 (bug 1183604) for hazard analysis failures.
CLOSED TREE
This commit is contained in:
Родитель
b26b131604
Коммит
a4bdad4b8a
|
@ -322,10 +322,8 @@ private:
|
|||
nsScriptObjectTracer* aTracer);
|
||||
|
||||
#ifdef DEBUG
|
||||
public:
|
||||
void CheckCCWrapperTraversal(void* aScriptObjectHolder,
|
||||
nsScriptObjectTracer* aTracer);
|
||||
private:
|
||||
#endif // DEBUG
|
||||
|
||||
/**
|
||||
|
|
|
@ -879,52 +879,6 @@ struct TypeNeedsOuterization
|
|||
IsBaseOf<nsGlobalWindow, T>::value || IsSame<EventTarget, T>::value;
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
template<typename T, bool isISupports=IsBaseOf<nsISupports, T>::value>
|
||||
struct CheckWrapperCacheTracing
|
||||
{
|
||||
static inline void Check(T* aObject)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct CheckWrapperCacheTracing<T, true>
|
||||
{
|
||||
static void Check(T* aObject)
|
||||
{
|
||||
nsWrapperCache* wrapperCacheFromQI = nullptr;
|
||||
aObject->QueryInterface(NS_GET_IID(nsWrapperCache),
|
||||
reinterpret_cast<void**>(&wrapperCacheFromQI));
|
||||
|
||||
MOZ_ASSERT(wrapperCacheFromQI,
|
||||
"Missing nsWrapperCache from QueryInterface implementation?");
|
||||
|
||||
if (!wrapperCacheFromQI->GetWrapperPreserveColor()) {
|
||||
// Can't assert that we trace the wrapper, since we don't have any
|
||||
// wrapper to trace.
|
||||
return;
|
||||
}
|
||||
|
||||
nsISupports* ccISupports = nullptr;
|
||||
aObject->QueryInterface(NS_GET_IID(nsCycleCollectionISupports),
|
||||
reinterpret_cast<void**>(&ccISupports));
|
||||
MOZ_ASSERT(ccISupports,
|
||||
"nsWrapperCache object which isn't cycle collectable?");
|
||||
|
||||
nsXPCOMCycleCollectionParticipant* participant = nullptr;
|
||||
CallQueryInterface(ccISupports, &participant);
|
||||
MOZ_ASSERT(participant, "Can't QI to CycleCollectionParticipant?");
|
||||
|
||||
bool wasPreservingWrapper = wrapperCacheFromQI->PreservingWrapper();
|
||||
wrapperCacheFromQI->SetPreservingWrapper(true);
|
||||
wrapperCacheFromQI->CheckCCWrapperTraversal(ccISupports, participant);
|
||||
wrapperCacheFromQI->SetPreservingWrapper(wasPreservingWrapper);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
template <class T, GetOrCreateReflectorWrapBehavior wrapBehavior>
|
||||
MOZ_ALWAYS_INLINE bool
|
||||
DoGetOrCreateDOMReflector(JSContext* cx, T* value,
|
||||
|
@ -949,12 +903,6 @@ DoGetOrCreateDOMReflector(JSContext* cx, T* value,
|
|||
// figure out whether WrapObject() threw.
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
if (IsBaseOf<nsWrapperCache, T>::value) {
|
||||
CheckWrapperCacheTracing<T>::Check(value);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
Загрузка…
Ссылка в новой задаче