Commit 3d89f7fb authored by wjmaclean's avatar wjmaclean Committed by Commit bot

Simplify by using the same code for didMoveIntoFrameHost and MoveBetween.

As a precursor step for removing event listener properties
prior to moving a node iterator, this CL attempts to simplify
the code in

EventHandlerRegistry::didMoveBetweenFrameHosts()

by having it re-use the
existing code in EventHandlerRegistry::didMoveIntoFrameHost(). While
this doesn't allow simply skimming the old properties off of the old
frameHost, presumably this is still equivalent and efficient enough
given that such moves presumably happen infrequently compared to things
like drawing frames, etc.

BUG=

Review-Url: https://codereview.chromium.org/2578873004
Cr-Commit-Position: refs/heads/master@{#439499}
parent 8e3745ac
......@@ -191,15 +191,8 @@ void EventHandlerRegistry::didMoveBetweenFrameHosts(EventTarget& target,
FrameHost* oldFrameHost,
FrameHost* newFrameHost) {
ASSERT(newFrameHost != oldFrameHost);
for (size_t i = 0; i < EventHandlerClassCount; ++i) {
EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i);
const EventTargetSet* targets =
&oldFrameHost->eventHandlerRegistry().m_targets[handlerClass];
for (unsigned count = targets->count(&target); count > 0; --count)
newFrameHost->eventHandlerRegistry().didAddEventHandler(target,
handlerClass);
}
oldFrameHost->eventHandlerRegistry().didRemoveAllEventHandlers(target);
oldFrameHost->eventHandlerRegistry().didMoveOutOfFrameHost(target);
newFrameHost->eventHandlerRegistry().didMoveIntoFrameHost(target);
}
void EventHandlerRegistry::didRemoveAllEventHandlers(EventTarget& target) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment