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

Side by Side Diff: Source/core/page/EventHandler.cpp

Issue 316443004: Oilpan: Remove ref counting from EventTarget and all uses of Pass/RefPtr<EventTarget>. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 3461 matching lines...) Expand 10 before | Expand all | Expand 10 after
3472 3472
3473 // Holds the complete set of touches on the screen. 3473 // Holds the complete set of touches on the screen.
3474 RefPtrWillBeRawPtr<TouchList> touches = TouchList::create(); 3474 RefPtrWillBeRawPtr<TouchList> touches = TouchList::create();
3475 3475
3476 // A different view on the 'touches' list above, filtered and grouped by 3476 // A different view on the 'touches' list above, filtered and grouped by
3477 // event target. Used for the 'targetTouches' list in the JS event. 3477 // event target. Used for the 'targetTouches' list in the JS event.
3478 typedef WillBeHeapHashMap<EventTarget*, RefPtrWillBeMember<TouchList> > Targ etTouchesHeapMap; 3478 typedef WillBeHeapHashMap<EventTarget*, RefPtrWillBeMember<TouchList> > Targ etTouchesHeapMap;
3479 TargetTouchesHeapMap touchesByTarget; 3479 TargetTouchesHeapMap touchesByTarget;
3480 3480
3481 // Array of touches per state, used to assemble the 'changedTouches' list. 3481 // Array of touches per state, used to assemble the 'changedTouches' list.
3482 typedef HashSet<RefPtr<EventTarget> > EventTargetSet; 3482 typedef WillBeHeapHashSet<RefPtrWillBeMember<EventTarget> > EventTargetSet;
3483 struct { 3483 struct {
3484 // The touches corresponding to the particular change state this struct 3484 // The touches corresponding to the particular change state this struct
3485 // instance represents. 3485 // instance represents.
3486 RefPtrWillBeMember<TouchList> m_touches; 3486 RefPtrWillBeMember<TouchList> m_touches;
3487 // Set of targets involved in m_touches. 3487 // Set of targets involved in m_touches.
3488 EventTargetSet m_targets; 3488 EventTargetSet m_targets;
3489 } changedTouches[PlatformTouchPoint::TouchStateEnd]; 3489 } changedTouches[PlatformTouchPoint::TouchStateEnd];
3490 3490
3491 for (i = 0; i < points.size(); ++i) { 3491 for (i = 0; i < points.size(); ++i) {
3492 const PlatformTouchPoint& point = points[i]; 3492 const PlatformTouchPoint& point = points[i];
3493 LayoutPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos() ); 3493 LayoutPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos() );
3494 PlatformTouchPoint::State pointState = point.state(); 3494 PlatformTouchPoint::State pointState = point.state();
3495 RefPtr<EventTarget> touchTarget; 3495 RefPtrWillBeRawPtr<EventTarget> touchTarget = nullptr;
3496 3496
3497 if (pointState == PlatformTouchPoint::TouchReleased || pointState == Pla tformTouchPoint::TouchCancelled) { 3497 if (pointState == PlatformTouchPoint::TouchReleased || pointState == Pla tformTouchPoint::TouchCancelled) {
3498 // The target should be the original target for this touch, so get 3498 // The target should be the original target for this touch, so get
3499 // it from the hashmap. As it's a release or cancel we also remove 3499 // it from the hashmap. As it's a release or cancel we also remove
3500 // it from the map. 3500 // it from the map.
3501 touchTarget = m_targetForTouchID.take(point.id()); 3501 touchTarget = m_targetForTouchID.take(point.id());
3502 } else { 3502 } else {
3503 // No hittest is performed on move or stationary, since the target 3503 // No hittest is performed on move or stationary, since the target
3504 // is not allowed to change anyway. 3504 // is not allowed to change anyway.
3505 touchTarget = m_targetForTouchID.get(point.id()); 3505 touchTarget = m_targetForTouchID.get(point.id());
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
3733 unsigned EventHandler::accessKeyModifiers() 3733 unsigned EventHandler::accessKeyModifiers()
3734 { 3734 {
3735 #if OS(MACOSX) 3735 #if OS(MACOSX)
3736 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3736 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3737 #else 3737 #else
3738 return PlatformEvent::AltKey; 3738 return PlatformEvent::AltKey;
3739 #endif 3739 #endif
3740 } 3740 }
3741 3741
3742 } // namespace WebCore 3742 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698