Chromium Code Reviews| Index: Source/core/page/EventHandler.cpp |
| diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp |
| index b57bd6b7781c32867ea8956bc983dfefad51be64..bc0d73354c43de881978209c6c2ecded9a3491a4 100644 |
| --- a/Source/core/page/EventHandler.cpp |
| +++ b/Source/core/page/EventHandler.cpp |
| @@ -88,6 +88,7 @@ |
| #include "core/svg/SVGDocument.h" |
| #include "core/svg/SVGElementInstance.h" |
| #include "core/svg/SVGUseElement.h" |
| +#include "heap/Handle.h" |
| #include "platform/PlatformGestureEvent.h" |
| #include "platform/PlatformKeyboardEvent.h" |
| #include "platform/PlatformTouchEvent.h" |
| @@ -3582,18 +3583,18 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) |
| // for an overview of how these lists fit together. |
| // Holds the complete set of touches on the screen and will be used as the 'touches' list in the JS event. |
| - RefPtr<TouchList> touches = TouchList::create(); |
| + RefPtrWillBeRawPtr<TouchList> touches = TouchList::create(); |
| // A different view on the 'touches' list above, filtered and grouped by event target. Used for the |
| // 'targetTouches' list in the JS event. |
| - typedef HashMap<EventTarget*, RefPtr<TouchList> > TargetTouchesMap; |
| + typedef WillBeHeapHashMap<EventTarget*, RefPtrWillBeMember<TouchList> > TargetTouchesMap; |
|
haraken
2014/03/05 14:52:46
TargetTouchesMap => TargetTouchesHeapMap (to make
sof
2014/03/05 16:01:12
Done.
|
| TargetTouchesMap touchesByTarget; |
| // Array of touches per state, used to assemble the 'changedTouches' list in the JS event. |
| typedef HashSet<RefPtr<EventTarget> > EventTargetSet; |
| struct { |
|
haraken
2014/03/05 14:52:46
Shall we add STACK_ALLOCATED ?
sof
2014/03/05 16:01:12
Done.
|
| // The touches corresponding to the particular change state this struct instance represents. |
| - RefPtr<TouchList> m_touches; |
| + RefPtrWillBeRawPtr<TouchList> m_touches; |
| // Set of targets involved in m_touches. |
| EventTargetSet m_targets; |
| } changedTouches[PlatformTouchPoint::TouchStateEnd]; |
| @@ -3712,7 +3713,7 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) |
| int adjustedRadiusX = lroundf(point.radiusX() / scaleFactor); |
| int adjustedRadiusY = lroundf(point.radiusY() / scaleFactor); |
| - RefPtr<Touch> touch = Touch::create(targetFrame, touchTarget.get(), point.id(), |
| + RefPtrWillBeRawPtr<Touch> touch = Touch::create(targetFrame, touchTarget.get(), point.id(), |
| point.screenPos().x(), point.screenPos().y(), |
| adjustedPageX, adjustedPageY, |
| adjustedRadiusX, adjustedRadiusY, |
| @@ -3752,20 +3753,20 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event) |
| // Now iterate the changedTouches list and m_targets within it, sending events to the targets as required. |
| bool swallowedEvent = false; |
| - RefPtr<TouchList> emptyList = TouchList::create(); |
| + RefPtrWillBeRawPtr<TouchList> emptyList = TouchList::create(); |
| for (unsigned state = 0; state != PlatformTouchPoint::TouchStateEnd; ++state) { |
| if (!changedTouches[state].m_touches) |
| continue; |
| // When sending a touch cancel event, use empty touches and targetTouches lists. |
| bool isTouchCancelEvent = (state == PlatformTouchPoint::TouchCancelled); |
| - RefPtr<TouchList>& effectiveTouches(isTouchCancelEvent ? emptyList : touches); |
| + RefPtrWillBeRawPtr<TouchList>& effectiveTouches(isTouchCancelEvent ? emptyList : touches); |
| const AtomicString& stateName(eventNameForTouchPointState(static_cast<PlatformTouchPoint::State>(state))); |
| const EventTargetSet& targetsForState = changedTouches[state].m_targets; |
| for (EventTargetSet::const_iterator it = targetsForState.begin(); it != targetsForState.end(); ++it) { |
| EventTarget* touchEventTarget = it->get(); |
| - RefPtr<TouchList> targetTouches(isTouchCancelEvent ? emptyList : touchesByTarget.get(touchEventTarget)); |
| + RefPtrWillBeRawPtr<TouchList> targetTouches(isTouchCancelEvent ? emptyList.get() : touchesByTarget.get(touchEventTarget)); |
| ASSERT(targetTouches); |
| RefPtr<TouchEvent> touchEvent = |