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

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: rebase 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
« no previous file with comments | « Source/core/page/EventHandler.h ('k') | Source/core/xml/XMLHttpRequestUpload.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3462 matching lines...) Expand 10 before | Expand all | Expand 10 after
3473 3473
3474 // Holds the complete set of touches on the screen. 3474 // Holds the complete set of touches on the screen.
3475 RefPtrWillBeRawPtr<TouchList> touches = TouchList::create(); 3475 RefPtrWillBeRawPtr<TouchList> touches = TouchList::create();
3476 3476
3477 // A different view on the 'touches' list above, filtered and grouped by 3477 // A different view on the 'touches' list above, filtered and grouped by
3478 // event target. Used for the 'targetTouches' list in the JS event. 3478 // event target. Used for the 'targetTouches' list in the JS event.
3479 typedef WillBeHeapHashMap<EventTarget*, RefPtrWillBeMember<TouchList> > Targ etTouchesHeapMap; 3479 typedef WillBeHeapHashMap<EventTarget*, RefPtrWillBeMember<TouchList> > Targ etTouchesHeapMap;
3480 TargetTouchesHeapMap touchesByTarget; 3480 TargetTouchesHeapMap touchesByTarget;
3481 3481
3482 // Array of touches per state, used to assemble the 'changedTouches' list. 3482 // Array of touches per state, used to assemble the 'changedTouches' list.
3483 typedef HashSet<RefPtr<EventTarget> > EventTargetSet; 3483 typedef WillBeHeapHashSet<RefPtrWillBeMember<EventTarget> > EventTargetSet;
3484 struct { 3484 struct {
3485 // The touches corresponding to the particular change state this struct 3485 // The touches corresponding to the particular change state this struct
3486 // instance represents. 3486 // instance represents.
3487 RefPtrWillBeMember<TouchList> m_touches; 3487 RefPtrWillBeMember<TouchList> m_touches;
3488 // Set of targets involved in m_touches. 3488 // Set of targets involved in m_touches.
3489 EventTargetSet m_targets; 3489 EventTargetSet m_targets;
3490 } changedTouches[PlatformTouchPoint::TouchStateEnd]; 3490 } changedTouches[PlatformTouchPoint::TouchStateEnd];
3491 3491
3492 for (i = 0; i < points.size(); ++i) { 3492 for (i = 0; i < points.size(); ++i) {
3493 const PlatformTouchPoint& point = points[i]; 3493 const PlatformTouchPoint& point = points[i];
3494 LayoutPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos() ); 3494 LayoutPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos() );
3495 PlatformTouchPoint::State pointState = point.state(); 3495 PlatformTouchPoint::State pointState = point.state();
3496 RefPtr<EventTarget> touchTarget; 3496 RefPtrWillBeRawPtr<EventTarget> touchTarget = nullptr;
3497 3497
3498 if (pointState == PlatformTouchPoint::TouchReleased || pointState == Pla tformTouchPoint::TouchCancelled) { 3498 if (pointState == PlatformTouchPoint::TouchReleased || pointState == Pla tformTouchPoint::TouchCancelled) {
3499 // The target should be the original target for this touch, so get 3499 // The target should be the original target for this touch, so get
3500 // it from the hashmap. As it's a release or cancel we also remove 3500 // it from the hashmap. As it's a release or cancel we also remove
3501 // it from the map. 3501 // it from the map.
3502 touchTarget = m_targetForTouchID.take(point.id()); 3502 touchTarget = m_targetForTouchID.take(point.id());
3503 } else { 3503 } else {
3504 // No hittest is performed on move or stationary, since the target 3504 // No hittest is performed on move or stationary, since the target
3505 // is not allowed to change anyway. 3505 // is not allowed to change anyway.
3506 touchTarget = m_targetForTouchID.get(point.id()); 3506 touchTarget = m_targetForTouchID.get(point.id());
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
3734 unsigned EventHandler::accessKeyModifiers() 3734 unsigned EventHandler::accessKeyModifiers()
3735 { 3735 {
3736 #if OS(MACOSX) 3736 #if OS(MACOSX)
3737 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3737 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3738 #else 3738 #else
3739 return PlatformEvent::AltKey; 3739 return PlatformEvent::AltKey;
3740 #endif 3740 #endif
3741 } 3741 }
3742 3742
3743 } // namespace WebCore 3743 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/EventHandler.h ('k') | Source/core/xml/XMLHttpRequestUpload.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698