Bug 1187782 (part 12) - Replace nsBaseHashtable::EnumerateRead() calls in dom/base/ with iterators. r=khuey.

--HG--
extra : rebase_source : 7247529b5e4d52686ef1bb0653933ca19716012e
This commit is contained in:
Nicholas Nethercote 2015-11-09 14:16:02 -08:00
Родитель 19408be4f3
Коммит 8a39d7f82e
2 изменённых файлов: 15 добавлений и 15 удалений

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

@ -1498,13 +1498,19 @@ nsDocument::nsDocument(const char* aContentType)
}
}
static PLDHashOperator
ClearAllBoxObjects(nsIContent* aKey, nsPIBoxObject* aBoxObject, void* aUserArg)
void
nsDocument::ClearAllBoxObjects()
{
if (aBoxObject) {
aBoxObject->Clear();
if (mBoxObjectTable) {
for (auto iter = mBoxObjectTable->Iter(); !iter.Done(); iter.Next()) {
nsPIBoxObject* boxObject = iter.UserData();
if (boxObject) {
boxObject->Clear();
}
}
delete mBoxObjectTable;
mBoxObjectTable = nullptr;
}
return PL_DHASH_NEXT;
}
nsIDocument::~nsIDocument()
@ -1653,10 +1659,7 @@ nsDocument::~nsDocument()
delete mHeaderData;
if (mBoxObjectTable) {
mBoxObjectTable->EnumerateRead(ClearAllBoxObjects, nullptr);
delete mBoxObjectTable;
}
ClearAllBoxObjects();
mPendingTitleChangeEvent.Revoke();
@ -1981,12 +1984,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mPreloadingImages)
if (tmp->mBoxObjectTable) {
tmp->mBoxObjectTable->EnumerateRead(ClearAllBoxObjects, nullptr);
delete tmp->mBoxObjectTable;
tmp->mBoxObjectTable = nullptr;
}
tmp->ClearAllBoxObjects();
if (tmp->mListenerManager) {
tmp->mListenerManager->Disconnect();

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

@ -1767,6 +1767,8 @@ private:
// requestAnimationFrame, if it's OK to do so.
void MaybeRescheduleAnimationFrameNotifications();
void ClearAllBoxObjects();
// Returns true if the scheme for the url for this document is "about"
bool IsAboutPage();