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

Side by Side Diff: Source/core/events/EventDispatcher.cpp

Issue 637223008: Use C++11 range-based loop in core/events (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/core/events/DOMWindowEventQueue.cpp ('k') | Source/core/events/EventListenerMap.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // We need to set the target here because it can go away by the time we actu ally fire the event. 69 // We need to set the target here because it can go away by the time we actu ally fire the event.
70 mediator->event()->setTarget(EventPath::eventTargetRespectingTargetRules(nod e)); 70 mediator->event()->setTarget(EventPath::eventTargetRespectingTargetRules(nod e));
71 ScopedEventQueue::instance()->enqueueEventDispatchMediator(mediator); 71 ScopedEventQueue::instance()->enqueueEventDispatchMediator(mediator);
72 } 72 }
73 73
74 void EventDispatcher::dispatchSimulatedClick(Node* node, Event* underlyingEvent, SimulatedClickMouseEventOptions mouseEventOptions) 74 void EventDispatcher::dispatchSimulatedClick(Node* node, Event* underlyingEvent, SimulatedClickMouseEventOptions mouseEventOptions)
75 { 75 {
76 // This persistent vector doesn't cause leaks, because added Nodes are remov ed 76 // This persistent vector doesn't cause leaks, because added Nodes are remov ed
77 // before dispatchSimulatedClick() returns. This vector is here just to prev ent 77 // before dispatchSimulatedClick() returns. This vector is here just to prev ent
78 // the code from running into an infinite recursion of dispatchSimulatedClic k(). 78 // the code from running into an infinite recursion of dispatchSimulatedClic k().
79 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WillBeHeapHashSet<RawPtrWillBeMem ber<Node> > >, nodesDispatchingSimulatedClicks, (adoptPtrWillBeNoop(new WillBeHe apHashSet<RawPtrWillBeMember<Node> >()))); 79 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WillBeHeapHashSet<RawPtrWillBeMem ber<Node>>>, nodesDispatchingSimulatedClicks, (adoptPtrWillBeNoop(new WillBeHeap HashSet<RawPtrWillBeMember<Node>>())));
80 80
81 if (isDisabledFormControl(node)) 81 if (isDisabledFormControl(node))
82 return; 82 return;
83 83
84 if (nodesDispatchingSimulatedClicks->contains(node)) 84 if (nodesDispatchingSimulatedClicks->contains(node))
85 return; 85 return;
86 86
87 nodesDispatchingSimulatedClicks->add(node); 87 nodesDispatchingSimulatedClicks->add(node);
88 88
89 if (mouseEventOptions == SendMouseOverUpDownEvents) 89 if (mouseEventOptions == SendMouseOverUpDownEvents)
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 227 }
228 } 228 }
229 } 229 }
230 230
231 const NodeEventContext* EventDispatcher::topNodeEventContext() 231 const NodeEventContext* EventDispatcher::topNodeEventContext()
232 { 232 {
233 return m_event->eventPath().isEmpty() ? 0 : &m_event->eventPath().last(); 233 return m_event->eventPath().isEmpty() ? 0 : &m_event->eventPath().last();
234 } 234 }
235 235
236 } 236 }
OLDNEW
« no previous file with comments | « Source/core/events/DOMWindowEventQueue.cpp ('k') | Source/core/events/EventListenerMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698