Bug 835503 - Remove nsCycleCollector::ShouldBeFreed/WasFreed, r=mccr8
This commit is contained in:
@@ -1373,10 +1373,6 @@ nsDocument::~nsDocument()
|
|||||||
("DOCUMENT %p destroyed", this));
|
("DOCUMENT %p destroyed", this));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
nsCycleCollector_DEBUG_wasFreed(static_cast<nsIDocument*>(this));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
NS_ASSERTION(!mIsShowing, "Destroying a currently-showing document");
|
NS_ASSERTION(!mIsShowing, "Destroying a currently-showing document");
|
||||||
|
|
||||||
mInDestructor = true;
|
mInDestructor = true;
|
||||||
|
|||||||
@@ -1151,10 +1151,6 @@ nsGlobalWindow::~nsGlobalWindow()
|
|||||||
|
|
||||||
CleanUp(true);
|
CleanUp(true);
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
nsCycleCollector_DEBUG_wasFreed(static_cast<nsIScriptGlobalObject*>(this));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
nsCOMPtr<nsIDeviceSensors> ac = do_GetService(NS_DEVICE_SENSORS_CONTRACTID);
|
nsCOMPtr<nsIDeviceSensors> ac = do_GetService(NS_DEVICE_SENSORS_CONTRACTID);
|
||||||
if (ac)
|
if (ac)
|
||||||
ac->RemoveWindowAsListener(this);
|
ac->RemoveWindowAsListener(this);
|
||||||
@@ -1285,9 +1281,6 @@ nsGlobalWindow::CleanUp(bool aIgnoreModalDialog)
|
|||||||
|
|
||||||
mOpener = nullptr; // Forces Release
|
mOpener = nullptr; // Forces Release
|
||||||
if (mContext) {
|
if (mContext) {
|
||||||
#ifdef DEBUG
|
|
||||||
nsCycleCollector_DEBUG_shouldBeFreed(mContext);
|
|
||||||
#endif
|
|
||||||
mContext = nullptr; // Forces Release
|
mContext = nullptr; // Forces Release
|
||||||
}
|
}
|
||||||
mChromeEventHandler = nullptr; // Forces Release
|
mChromeEventHandler = nullptr; // Forces Release
|
||||||
@@ -1321,9 +1314,6 @@ nsGlobalWindow::CleanUp(bool aIgnoreModalDialog)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DisableTimeChangeNotifications();
|
DisableTimeChangeNotifications();
|
||||||
#ifdef DEBUG
|
|
||||||
nsCycleCollector_DEBUG_shouldBeFreed(static_cast<nsIScriptGlobalObject*>(this));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1407,11 +1397,6 @@ nsGlobalWindow::FreeInnerObjects()
|
|||||||
mDocBaseURI = mDoc->GetDocBaseURI();
|
mDocBaseURI = mDoc->GetDocBaseURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
if (mDocument)
|
|
||||||
nsCycleCollector_DEBUG_shouldBeFreed(nsCOMPtr<nsISupports>(do_QueryInterface(mDocument)));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Remove our reference to the document and the document principal.
|
// Remove our reference to the document and the document principal.
|
||||||
mDocument = nullptr;
|
mDocument = nullptr;
|
||||||
mDoc = nullptr;
|
mDoc = nullptr;
|
||||||
@@ -1432,10 +1417,6 @@ nsGlobalWindow::FreeInnerObjects()
|
|||||||
mAudioContexts[i]->Shutdown();
|
mAudioContexts[i]->Shutdown();
|
||||||
}
|
}
|
||||||
mAudioContexts.Clear();
|
mAudioContexts.Clear();
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
nsCycleCollector_DEBUG_shouldBeFreed(static_cast<nsIScriptGlobalObject*>(this));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
@@ -2599,11 +2580,6 @@ nsGlobalWindow::DetachFromDocShell()
|
|||||||
mContext = nullptr;
|
mContext = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
nsCycleCollector_DEBUG_shouldBeFreed(mContext);
|
|
||||||
nsCycleCollector_DEBUG_shouldBeFreed(static_cast<nsIScriptGlobalObject*>(this));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
mDocShell = nullptr; // Weak Reference
|
mDocShell = nullptr; // Weak Reference
|
||||||
|
|
||||||
NS_ASSERTION(!mNavigator, "Non-null mNavigator in outer window!");
|
NS_ASSERTION(!mNavigator, "Non-null mNavigator in outer window!");
|
||||||
|
|||||||
@@ -1136,10 +1136,6 @@ nsJSContext::nsJSContext(JSRuntime *aRuntime, bool aGCOnDestruction,
|
|||||||
|
|
||||||
nsJSContext::~nsJSContext()
|
nsJSContext::~nsJSContext()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
|
||||||
nsCycleCollector_DEBUG_wasFreed(static_cast<nsIScriptContext*>(this));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
*mPrev = mNext;
|
*mPrev = mNext;
|
||||||
if (mNext) {
|
if (mNext) {
|
||||||
mNext->mPrev = mPrev;
|
mNext->mPrev = mPrev;
|
||||||
|
|||||||
@@ -1100,13 +1100,9 @@ struct nsCycleCollector
|
|||||||
#ifdef DEBUG_CC
|
#ifdef DEBUG_CC
|
||||||
nsCycleCollectorStats mStats;
|
nsCycleCollectorStats mStats;
|
||||||
FILE *mPtrLog;
|
FILE *mPtrLog;
|
||||||
PointerSet mExpectedGarbage;
|
|
||||||
|
|
||||||
bool LogPurpleAddition(void* aObject, nsCycleCollectionParticipant *cp);
|
bool LogPurpleAddition(void* aObject, nsCycleCollectionParticipant *cp);
|
||||||
void LogPurpleRemoval(void* aObject);
|
void LogPurpleRemoval(void* aObject);
|
||||||
|
|
||||||
void ShouldBeFreed(nsISupports *n);
|
|
||||||
void WasFreed(nsISupports *n);
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2545,9 +2541,6 @@ nsCycleCollector::nsCycleCollector() :
|
|||||||
mPurpleBuf(mParams)
|
mPurpleBuf(mParams)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_CC
|
|
||||||
mExpectedGarbage.Init();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3098,24 +3091,6 @@ nsCycleCollector::Shutdown()
|
|||||||
mParams.mDoNothing = true;
|
mParams.mDoNothing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_CC
|
|
||||||
void
|
|
||||||
nsCycleCollector::ShouldBeFreed(nsISupports *n)
|
|
||||||
{
|
|
||||||
if (n) {
|
|
||||||
mExpectedGarbage.PutEntry(n);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
nsCycleCollector::WasFreed(nsISupports *n)
|
|
||||||
{
|
|
||||||
if (n) {
|
|
||||||
mExpectedGarbage.RemoveEntry(n);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
nsCycleCollector::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
nsCycleCollector::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
||||||
size_t *aObjectSize,
|
size_t *aObjectSize,
|
||||||
@@ -3140,7 +3115,7 @@ nsCycleCollector::SizeOfIncludingThis(nsMallocSizeOfFun aMallocSizeOf,
|
|||||||
// - mResults: because it's tiny and only contains scalars.
|
// - mResults: because it's tiny and only contains scalars.
|
||||||
// - mJSRuntime: because it's non-owning and measured by JS reporters.
|
// - mJSRuntime: because it's non-owning and measured by JS reporters.
|
||||||
// - mParams: because it only contains scalars.
|
// - mParams: because it only contains scalars.
|
||||||
// - mStats, mPtrLog, mExpectedGarbage: because they're DEBUG_CC-only.
|
// - mStats, mPtrLog: because they're DEBUG_CC-only.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3183,26 +3158,6 @@ nsCycleCollector_suspectedCount()
|
|||||||
return sCollector ? sCollector->SuspectedCount() : 0;
|
return sCollector ? sCollector->SuspectedCount() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
void
|
|
||||||
nsCycleCollector_DEBUG_shouldBeFreed(nsISupports *n)
|
|
||||||
{
|
|
||||||
#ifdef DEBUG_CC
|
|
||||||
if (sCollector)
|
|
||||||
sCollector->ShouldBeFreed(n);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
nsCycleCollector_DEBUG_wasFreed(nsISupports *n)
|
|
||||||
{
|
|
||||||
#ifdef DEBUG_CC
|
|
||||||
if (sCollector)
|
|
||||||
sCollector->WasFreed(n);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class nsCycleCollectorRunner : public nsRunnable
|
class nsCycleCollectorRunner : public nsRunnable
|
||||||
{
|
{
|
||||||
nsCycleCollector *mCollector;
|
nsCycleCollector *mCollector;
|
||||||
|
|||||||
@@ -97,11 +97,6 @@ struct nsCycleCollectionJSRuntime
|
|||||||
void nsCycleCollector_registerJSRuntime(nsCycleCollectionJSRuntime *rt);
|
void nsCycleCollector_registerJSRuntime(nsCycleCollectionJSRuntime *rt);
|
||||||
void nsCycleCollector_forgetJSRuntime();
|
void nsCycleCollector_forgetJSRuntime();
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
void nsCycleCollector_DEBUG_shouldBeFreed(nsISupports *n);
|
|
||||||
void nsCycleCollector_DEBUG_wasFreed(nsISupports *n);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define NS_CYCLE_COLLECTOR_LOGGER_CID \
|
#define NS_CYCLE_COLLECTOR_LOGGER_CID \
|
||||||
{ 0x58be81b4, 0x39d2, 0x437c, \
|
{ 0x58be81b4, 0x39d2, 0x437c, \
|
||||||
{ 0x94, 0xea, 0xae, 0xde, 0x2c, 0x62, 0x08, 0xd3 } }
|
{ 0x94, 0xea, 0xae, 0xde, 0x2c, 0x62, 0x08, 0xd3 } }
|
||||||
|
|||||||
Reference in New Issue
Block a user