Bug 1363036 - Part 1: Remove MOZ_DIAGNOSTIC_ASSERTs previously added for bug hunting. r=smaug

MozReview-Commit-ID: BAkuRlHtMcP

--HG--
extra : rebase_source : 5e708d0dacec9a673851d689d1f5274a0f1b69aa
This commit is contained in:
Samael Wang 2017-05-22 11:25:54 +08:00
Родитель 715b00892d
Коммит ecbe18e933
4 изменённых файлов: 9 добавлений и 12 удалений

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

@ -979,7 +979,7 @@ nsSHEntry::SetSHistory(nsISHistory* aSHistory)
{
nsWeakPtr shistory = do_GetWeakReference(aSHistory);
// mSHistory can not be changed once it's set
MOZ_DIAGNOSTIC_ASSERT(!mShared->mSHistory || (mShared->mSHistory == shistory));
MOZ_ASSERT(!mShared->mSHistory || (mShared->mSHistory == shistory));
mShared->mSHistory = shistory;
return NS_OK;
}

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

@ -137,7 +137,7 @@ nsSHEntryShared::SetContentViewer(nsIContentViewer* aViewer)
// If we're setting mContentViewer to null, state should already be cleared
// in the DropPresentationState() call above; If we're setting it to a
// non-null content viewer, the entry shouldn't have been tracked either.
MOZ_DIAGNOSTIC_ASSERT(!GetExpirationState()->IsTracked());
MOZ_ASSERT(!GetExpirationState()->IsTracked());
mContentViewer = aViewer;
if (mContentViewer) {

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

@ -1320,7 +1320,7 @@ NS_IMETHODIMP
nsSHistory::RemoveFromExpirationTracker(nsIBFCacheEntry* aEntry)
{
RefPtr<nsSHEntryShared> entry = static_cast<nsSHEntryShared*>(aEntry);
MOZ_DIAGNOSTIC_ASSERT(mHistoryTracker && !mHistoryTracker->IsEmpty());
MOZ_ASSERT(mHistoryTracker && !mHistoryTracker->IsEmpty());
if (!mHistoryTracker || !entry) {
return NS_ERROR_FAILURE;
}
@ -1928,7 +1928,6 @@ nsSHistory::InitiateLoad(nsISHEntry* aFrameEntry, nsIDocShell* aFrameDS,
NS_IMETHODIMP
nsSHistory::SetRootDocShell(nsIDocShell* aDocShell)
{
MOZ_DIAGNOSTIC_ASSERT(!aDocShell || !mRootDocShell);
mRootDocShell = aDocShell;
// Init mHistoryTracker on setting mRootDocShell so we can bind its event
@ -1939,8 +1938,6 @@ nsSHistory::SetRootDocShell(nsIDocShell* aDocShell)
return NS_ERROR_UNEXPECTED;
}
// mHistroyTracker can only be set once.
MOZ_DIAGNOSTIC_ASSERT(!mHistoryTracker);
RefPtr<mozilla::dom::TabGroup> tabGroup = win->TabGroup();
mHistoryTracker = mozilla::MakeUnique<HistoryTracker>(
this,

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

@ -147,8 +147,8 @@ public:
nsresult AddObjectLocked(T* aObj, const AutoLock& aAutoLock)
{
nsExpirationState* state = aObj->GetExpirationState();
MOZ_DIAGNOSTIC_ASSERT(!state->IsTracked(),
"Tried to add an object that's already tracked");
MOZ_ASSERT(!state->IsTracked(),
"Tried to add an object that's already tracked");
nsTArray<T*>& generation = mGenerations[mNewestGeneration];
uint32_t index = generation.Length();
if (index > nsExpirationState::MAX_INDEX_IN_GENERATION) {
@ -176,18 +176,18 @@ public:
void RemoveObjectLocked(T* aObj, const AutoLock& aAutoLock)
{
nsExpirationState* state = aObj->GetExpirationState();
MOZ_DIAGNOSTIC_ASSERT(state->IsTracked(), "Tried to remove an object that's not tracked");
MOZ_ASSERT(state->IsTracked(), "Tried to remove an object that's not tracked");
nsTArray<T*>& generation = mGenerations[state->mGeneration];
uint32_t index = state->mIndexInGeneration;
MOZ_DIAGNOSTIC_ASSERT(generation.Length() > index &&
generation[index] == aObj, "Object is lying about its index");
MOZ_ASSERT(generation.Length() > index &&
generation[index] == aObj, "Object is lying about its index");
// Move the last object to fill the hole created by removing aObj
uint32_t last = generation.Length() - 1;
T* lastObj = generation[last];
generation[index] = lastObj;
lastObj->GetExpirationState()->mIndexInGeneration = index;
generation.RemoveElementAt(last);
MOZ_DIAGNOSTIC_ASSERT(generation.Length() == last);
MOZ_ASSERT(generation.Length() == last);
state->mGeneration = nsExpirationState::NOT_TRACKED;
// We do not check whether we need to stop the timer here. The timer
// will check that itself next time it fires. Checking here would not