Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2617783002: Migrate WTF::Vector::append() to ::push_back() [part 12 of N] (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 ASSERT(m_frame == m_frame->localFrameRoot()); 1500 ASSERT(m_frame == m_frame->localFrameRoot());
1501 1501
1502 HeapVector<Member<LocalFrame>> newHoverFrameChain; 1502 HeapVector<Member<LocalFrame>> newHoverFrameChain;
1503 LocalFrame* newHoverFrameInDocument = 1503 LocalFrame* newHoverFrameInDocument =
1504 innerElement ? innerElement->document().frame() : nullptr; 1504 innerElement ? innerElement->document().frame() : nullptr;
1505 // Insert the ancestors of the frame having the new hovered node to the frame 1505 // Insert the ancestors of the frame having the new hovered node to the frame
1506 // chain The frame chain doesn't include the main frame to avoid the redundant 1506 // chain The frame chain doesn't include the main frame to avoid the redundant
1507 // work that cleans the hover state. Because the hover state for the main 1507 // work that cleans the hover state. Because the hover state for the main
1508 // frame is updated by calling Document::updateHoverActiveState 1508 // frame is updated by calling Document::updateHoverActiveState
1509 while (newHoverFrameInDocument && newHoverFrameInDocument != m_frame) { 1509 while (newHoverFrameInDocument && newHoverFrameInDocument != m_frame) {
1510 newHoverFrameChain.append(newHoverFrameInDocument); 1510 newHoverFrameChain.push_back(newHoverFrameInDocument);
1511 Frame* parentFrame = newHoverFrameInDocument->tree().parent(); 1511 Frame* parentFrame = newHoverFrameInDocument->tree().parent();
1512 newHoverFrameInDocument = parentFrame && parentFrame->isLocalFrame() 1512 newHoverFrameInDocument = parentFrame && parentFrame->isLocalFrame()
1513 ? toLocalFrame(parentFrame) 1513 ? toLocalFrame(parentFrame)
1514 : nullptr; 1514 : nullptr;
1515 } 1515 }
1516 1516
1517 Node* oldHoverNodeInCurDoc = m_frame->document()->hoverNode(); 1517 Node* oldHoverNodeInCurDoc = m_frame->document()->hoverNode();
1518 Node* newInnermostHoverNode = innerElement; 1518 Node* newInnermostHoverNode = innerElement;
1519 1519
1520 if (newInnermostHoverNode != oldHoverNodeInCurDoc) { 1520 if (newInnermostHoverNode != oldHoverNodeInCurDoc) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 // out. 1570 // out.
1571 // - Dispatch mouseover/mouseenter events of the entered frames into the 1571 // - Dispatch mouseover/mouseenter events of the entered frames into the
1572 // inside. 1572 // inside.
1573 1573
1574 // Insert the ancestors of the frame having the new target node to the entered 1574 // Insert the ancestors of the frame having the new target node to the entered
1575 // frame chain. 1575 // frame chain.
1576 HeapVector<Member<LocalFrame>> enteredFrameChain; 1576 HeapVector<Member<LocalFrame>> enteredFrameChain;
1577 LocalFrame* enteredFrameInDocument = 1577 LocalFrame* enteredFrameInDocument =
1578 targetedEvent.hitTestResult().innerNodeFrame(); 1578 targetedEvent.hitTestResult().innerNodeFrame();
1579 while (enteredFrameInDocument) { 1579 while (enteredFrameInDocument) {
1580 enteredFrameChain.append(enteredFrameInDocument); 1580 enteredFrameChain.push_back(enteredFrameInDocument);
1581 Frame* parentFrame = enteredFrameInDocument->tree().parent(); 1581 Frame* parentFrame = enteredFrameInDocument->tree().parent();
1582 enteredFrameInDocument = parentFrame && parentFrame->isLocalFrame() 1582 enteredFrameInDocument = parentFrame && parentFrame->isLocalFrame()
1583 ? toLocalFrame(parentFrame) 1583 ? toLocalFrame(parentFrame)
1584 : nullptr; 1584 : nullptr;
1585 } 1585 }
1586 1586
1587 size_t indexEnteredFrameChain = enteredFrameChain.size(); 1587 size_t indexEnteredFrameChain = enteredFrameChain.size();
1588 LocalFrame* exitedFrameInDocument = m_frame; 1588 LocalFrame* exitedFrameInDocument = m_frame;
1589 HeapVector<Member<LocalFrame>> exitedFrameChain; 1589 HeapVector<Member<LocalFrame>> exitedFrameChain;
1590 // Insert the frame from the disagreement between last frames and entered 1590 // Insert the frame from the disagreement between last frames and entered
1591 // frames. 1591 // frames.
1592 while (exitedFrameInDocument) { 1592 while (exitedFrameInDocument) {
1593 Node* lastNodeUnderTap = exitedFrameInDocument->eventHandler() 1593 Node* lastNodeUnderTap = exitedFrameInDocument->eventHandler()
1594 .m_mouseEventManager->getNodeUnderMouse(); 1594 .m_mouseEventManager->getNodeUnderMouse();
1595 if (!lastNodeUnderTap) 1595 if (!lastNodeUnderTap)
1596 break; 1596 break;
1597 1597
1598 LocalFrame* nextExitedFrameInDocument = nullptr; 1598 LocalFrame* nextExitedFrameInDocument = nullptr;
1599 if (lastNodeUnderTap->isFrameOwnerElement()) { 1599 if (lastNodeUnderTap->isFrameOwnerElement()) {
1600 HTMLFrameOwnerElement* owner = toHTMLFrameOwnerElement(lastNodeUnderTap); 1600 HTMLFrameOwnerElement* owner = toHTMLFrameOwnerElement(lastNodeUnderTap);
1601 if (owner->contentFrame() && owner->contentFrame()->isLocalFrame()) 1601 if (owner->contentFrame() && owner->contentFrame()->isLocalFrame())
1602 nextExitedFrameInDocument = toLocalFrame(owner->contentFrame()); 1602 nextExitedFrameInDocument = toLocalFrame(owner->contentFrame());
1603 } 1603 }
1604 1604
1605 if (exitedFrameChain.size() > 0) { 1605 if (exitedFrameChain.size() > 0) {
1606 exitedFrameChain.append(exitedFrameInDocument); 1606 exitedFrameChain.push_back(exitedFrameInDocument);
1607 } else { 1607 } else {
1608 LocalFrame* lastEnteredFrameInDocument = 1608 LocalFrame* lastEnteredFrameInDocument =
1609 indexEnteredFrameChain ? enteredFrameChain[indexEnteredFrameChain - 1] 1609 indexEnteredFrameChain ? enteredFrameChain[indexEnteredFrameChain - 1]
1610 : nullptr; 1610 : nullptr;
1611 if (exitedFrameInDocument != lastEnteredFrameInDocument) 1611 if (exitedFrameInDocument != lastEnteredFrameInDocument)
1612 exitedFrameChain.append(exitedFrameInDocument); 1612 exitedFrameChain.push_back(exitedFrameInDocument);
1613 else if (nextExitedFrameInDocument && indexEnteredFrameChain) 1613 else if (nextExitedFrameInDocument && indexEnteredFrameChain)
1614 --indexEnteredFrameChain; 1614 --indexEnteredFrameChain;
1615 } 1615 }
1616 exitedFrameInDocument = nextExitedFrameInDocument; 1616 exitedFrameInDocument = nextExitedFrameInDocument;
1617 } 1617 }
1618 1618
1619 const WebGestureEvent& gestureEvent = targetedEvent.event(); 1619 const WebGestureEvent& gestureEvent = targetedEvent.event();
1620 unsigned modifiers = gestureEvent.modifiers; 1620 unsigned modifiers = gestureEvent.modifiers;
1621 PlatformMouseEvent fakeMouseMove( 1621 PlatformMouseEvent fakeMouseMove(
1622 gestureEvent, WebPointerProperties::Button::NoButton, 1622 gestureEvent, WebPointerProperties::Button::NoButton,
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 } 2125 }
2126 2126
2127 FrameHost* EventHandler::frameHost() const { 2127 FrameHost* EventHandler::frameHost() const {
2128 if (!m_frame->page()) 2128 if (!m_frame->page())
2129 return nullptr; 2129 return nullptr;
2130 2130
2131 return &m_frame->page()->frameHost(); 2131 return &m_frame->page()->frameHost();
2132 } 2132 }
2133 2133
2134 } // namespace blink 2134 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698