Skip to content

Commit

Permalink
Bug 1187151 (part 14) - Replace nsBaseHashtable::Enumerate() calls in…
Browse files Browse the repository at this point in the history
… dom/ with iterators. r=baku.
  • Loading branch information
nnethercote committed Jan 28, 2016
1 parent e971478 commit 78661dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
17 changes: 9 additions & 8 deletions dom/events/EventStateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dom/events/EventStateManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -875,9 +875,9 @@ class EventStateManager : public nsSupportsWeakReference,
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);
Expand Down

0 comments on commit 78661dc

Please sign in to comment.