Bug 1187151 (part 14) - Replace nsBaseHashtable::Enumerate() calls in dom/ with iterators. r=baku.

--HG--
extra : rebase_source : c211bfa5c6995b2564c7e356d8edb192a7bdba9e
This commit is contained in:
Nicholas Nethercote 2016-01-28 14:08:19 -08:00
parent 4d79a620bf
commit 9fa2681d82
2 changed files with 12 additions and 11 deletions

View File

@ -5030,19 +5030,17 @@ EventStateManager::SetContentState(nsIContent* aContent, EventStates aState)
return true;
}
PLDHashOperator
void
EventStateManager::ResetLastOverForContent(
const uint32_t& aIdx,
RefPtr<OverOutElementsWrapper>& aElemWrapper,
void* aClosure)
nsIContent* aContent)
{
nsIContent* content = static_cast<nsIContent*>(aClosure);
if (aElemWrapper && aElemWrapper->mLastOverElement &&
nsContentUtils::ContentIsDescendantOf(aElemWrapper->mLastOverElement, content)) {
nsContentUtils::ContentIsDescendantOf(aElemWrapper->mLastOverElement,
aContent)) {
aElemWrapper->mLastOverElement = nullptr;
}
return PL_DHASH_NEXT;
}
void
@ -5091,8 +5089,11 @@ EventStateManager::ContentRemoved(nsIDocument* aDocument, nsIContent* aContent)
// See bug 292146 for why we want to null this out
ResetLastOverForContent(0, mMouseEnterLeaveHelper, aContent);
mPointersEnterLeaveHelper.Enumerate(
&EventStateManager::ResetLastOverForContent, aContent);
for (auto iter = mPointersEnterLeaveHelper.Iter();
!iter.Done();
iter.Next()) {
ResetLastOverForContent(iter.Key(), iter.Data(), aContent);
}
}
bool

View File

@ -875,9 +875,9 @@ private:
nsIContent* aStopBefore,
EventStates aState,
bool aAddState);
static PLDHashOperator ResetLastOverForContent(const uint32_t& aIdx,
RefPtr<OverOutElementsWrapper>& aChunk,
void* aClosure);
static void ResetLastOverForContent(const uint32_t& aIdx,
RefPtr<OverOutElementsWrapper>& aChunk,
nsIContent* aClosure);
void PostHandleKeyboardEvent(WidgetKeyboardEvent* aKeyboardEvent,
nsEventStatus& aStatus,
bool dispatchedToContentProcess);