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

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

Issue 210823007: Add TRACE_EVENT for common events in EventHandler (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « no previous file | Source/core/page/EventHandler.cpp » ('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 23 matching lines...) Expand all
34 #include "core/inspector/InspectorInstrumentation.h" 34 #include "core/inspector/InspectorInstrumentation.h"
35 #include "core/frame/FrameView.h" 35 #include "core/frame/FrameView.h"
36 #include "wtf/RefPtr.h" 36 #include "wtf/RefPtr.h"
37 37
38 namespace WebCore { 38 namespace WebCore {
39 39
40 static HashSet<Node*>* gNodesDispatchingSimulatedClicks = 0; 40 static HashSet<Node*>* gNodesDispatchingSimulatedClicks = 0;
41 41
42 bool EventDispatcher::dispatchEvent(Node* node, PassRefPtr<EventDispatchMediator > mediator) 42 bool EventDispatcher::dispatchEvent(Node* node, PassRefPtr<EventDispatchMediator > mediator)
43 { 43 {
44 TRACE_EVENT0("webkit", "EventDispatcher::dispatchEvent");
44 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 45 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
45 if (!mediator->event()) 46 if (!mediator->event())
46 return true; 47 return true;
47 EventDispatcher dispatcher(node, mediator->event()); 48 EventDispatcher dispatcher(node, mediator->event());
48 return mediator->dispatchEvent(&dispatcher); 49 return mediator->dispatchEvent(&dispatcher);
49 } 50 }
50 51
51 EventDispatcher::EventDispatcher(Node* node, PassRefPtr<Event> event) 52 EventDispatcher::EventDispatcher(Node* node, PassRefPtr<Event> event)
52 : m_node(node) 53 : m_node(node)
53 , m_event(event) 54 , m_event(event)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 node->setActive(false); 93 node->setActive(false);
93 94
94 // always send click 95 // always send click
95 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::click, nod e->document().domWindow(), underlyingEvent)).dispatch(); 96 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::click, nod e->document().domWindow(), underlyingEvent)).dispatch();
96 97
97 gNodesDispatchingSimulatedClicks->remove(node); 98 gNodesDispatchingSimulatedClicks->remove(node);
98 } 99 }
99 100
100 bool EventDispatcher::dispatch() 101 bool EventDispatcher::dispatch()
101 { 102 {
103 TRACE_EVENT0("webkit", "EventDispatcher::dispatch");
104
102 #ifndef NDEBUG 105 #ifndef NDEBUG
103 ASSERT(!m_eventDispatched); 106 ASSERT(!m_eventDispatched);
104 m_eventDispatched = true; 107 m_eventDispatched = true;
105 #endif 108 #endif
106 ChildNodesLazySnapshot::takeChildNodesLazySnapshot(); 109 ChildNodesLazySnapshot::takeChildNodesLazySnapshot();
107 110
108 m_event->setTarget(EventPath::eventTargetRespectingTargetRules(m_node.get()) ); 111 m_event->setTarget(EventPath::eventTargetRespectingTargetRules(m_node.get()) );
109 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); 112 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
110 ASSERT(m_event->target()); 113 ASSERT(m_event->target());
111 WindowEventContext windowEventContext(m_event.get(), m_node.get(), topNodeEv entContext()); 114 WindowEventContext windowEventContext(m_event.get(), m_node.get(), topNodeEv entContext());
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 219 }
217 } 220 }
218 } 221 }
219 222
220 const NodeEventContext* EventDispatcher::topNodeEventContext() 223 const NodeEventContext* EventDispatcher::topNodeEventContext()
221 { 224 {
222 return m_event->eventPath().isEmpty() ? 0 : &m_event->eventPath().last(); 225 return m_event->eventPath().isEmpty() ? 0 : &m_event->eventPath().last();
223 } 226 }
224 227
225 } 228 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698