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

Side by Side Diff: Source/core/events/EventSender.h

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated 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 | « Source/core/events/DOMWindowEventQueue.cpp ('k') | Source/core/events/GenericEventQueue.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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 template<typename T> EventSender<T>::EventSender(const AtomicString& eventType) 61 template<typename T> EventSender<T>::EventSender(const AtomicString& eventType)
62 : m_eventType(eventType) 62 : m_eventType(eventType)
63 , m_timer(this, &EventSender::timerFired) 63 , m_timer(this, &EventSender::timerFired)
64 { 64 {
65 } 65 }
66 66
67 template<typename T> void EventSender<T>::dispatchEventSoon(T* sender) 67 template<typename T> void EventSender<T>::dispatchEventSoon(T* sender)
68 { 68 {
69 m_dispatchSoonList.append(sender); 69 m_dispatchSoonList.append(sender);
70 if (!m_timer.isActive()) 70 if (!m_timer.isActive())
71 m_timer.startOneShot(0); 71 m_timer.startOneShot(0, FROM_HERE);
72 } 72 }
73 73
74 template<typename T> void EventSender<T>::cancelEvent(T* sender) 74 template<typename T> void EventSender<T>::cancelEvent(T* sender)
75 { 75 {
76 // Remove instances of this sender from both lists. 76 // Remove instances of this sender from both lists.
77 // Use loops because we allow multiple instances to get into the lists. 77 // Use loops because we allow multiple instances to get into the lists.
78 size_t size = m_dispatchSoonList.size(); 78 size_t size = m_dispatchSoonList.size();
79 for (size_t i = 0; i < size; ++i) { 79 for (size_t i = 0; i < size; ++i) {
80 if (m_dispatchSoonList[i] == sender) 80 if (m_dispatchSoonList[i] == sender)
81 m_dispatchSoonList[i] = 0; 81 m_dispatchSoonList[i] = 0;
(...skipping 22 matching lines...) Expand all
104 m_dispatchingList[i] = 0; 104 m_dispatchingList[i] = 0;
105 sender->dispatchPendingEvent(this); 105 sender->dispatchPendingEvent(this);
106 } 106 }
107 } 107 }
108 m_dispatchingList.clear(); 108 m_dispatchingList.clear();
109 } 109 }
110 110
111 } // namespace WebCore 111 } // namespace WebCore
112 112
113 #endif // EventSender_h 113 #endif // EventSender_h
OLDNEW
« no previous file with comments | « Source/core/events/DOMWindowEventQueue.cpp ('k') | Source/core/events/GenericEventQueue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698