OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org) | 2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org) |
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 | 82 |
83 void GenericEventQueue::timerFired(Timer<GenericEventQueue>*) | 83 void GenericEventQueue::timerFired(Timer<GenericEventQueue>*) |
84 { | 84 { |
85 ASSERT(!m_timer.isActive()); | 85 ASSERT(!m_timer.isActive()); |
86 ASSERT(!m_pendingEvents.isEmpty()); | 86 ASSERT(!m_pendingEvents.isEmpty()); |
87 | 87 |
88 WillBeHeapVector<RefPtrWillBeMember<Event> > pendingEvents; | 88 WillBeHeapVector<RefPtrWillBeMember<Event> > pendingEvents; |
89 m_pendingEvents.swap(pendingEvents); | 89 m_pendingEvents.swap(pendingEvents); |
90 | 90 |
91 RefPtr<EventTarget> protect(m_owner); | 91 RefPtrWillBeRawPtr<EventTarget> protect(m_owner); |
92 for (size_t i = 0; i < pendingEvents.size(); ++i) { | 92 for (size_t i = 0; i < pendingEvents.size(); ++i) { |
93 Event* event = pendingEvents[i].get(); | 93 Event* event = pendingEvents[i].get(); |
94 EventTarget* target = event->target() ? event->target() : m_owner; | 94 EventTarget* target = event->target() ? event->target() : m_owner; |
95 CString type(event->type().ascii()); | 95 CString type(event->type().ascii()); |
96 TRACE_EVENT_ASYNC_STEP_INTO1("event", "GenericEventQueue:enqueueEvent",
event, "dispatch", "type", type); | 96 TRACE_EVENT_ASYNC_STEP_INTO1("event", "GenericEventQueue:enqueueEvent",
event, "dispatch", "type", type); |
97 target->dispatchEvent(pendingEvents[i].release()); | 97 target->dispatchEvent(pendingEvents[i].release()); |
98 TRACE_EVENT_ASYNC_END1("event", "GenericEventQueue:enqueueEvent", event,
"type", type); | 98 TRACE_EVENT_ASYNC_END1("event", "GenericEventQueue:enqueueEvent", event,
"type", type); |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
(...skipping 13 matching lines...) Expand all Loading... |
115 } | 115 } |
116 m_pendingEvents.clear(); | 116 m_pendingEvents.clear(); |
117 } | 117 } |
118 | 118 |
119 bool GenericEventQueue::hasPendingEvents() const | 119 bool GenericEventQueue::hasPendingEvents() const |
120 { | 120 { |
121 return m_pendingEvents.size(); | 121 return m_pendingEvents.size(); |
122 } | 122 } |
123 | 123 |
124 } | 124 } |
OLD | NEW |