| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 if (m_queuedEvents.isEmpty()) | 101 if (m_queuedEvents.isEmpty()) |
| 102 m_pendingEventTimer->stop(); | 102 m_pendingEventTimer->stop(); |
| 103 return found; | 103 return found; |
| 104 } | 104 } |
| 105 | 105 |
| 106 void DOMWindowEventQueue::close() | 106 void DOMWindowEventQueue::close() |
| 107 { | 107 { |
| 108 m_isClosed = true; | 108 m_isClosed = true; |
| 109 m_pendingEventTimer->stop(); | 109 m_pendingEventTimer->stop(); |
| 110 if (InspectorInstrumentation::hasFrontends()) { | 110 if (InspectorInstrumentation::hasFrontends()) { |
| 111 WillBeHeapListHashSet<RefPtrWillBeMember<Event>, 16>::iterator it = m_qu
euedEvents.begin(); | 111 for (const auto& queuedEvent : m_queuedEvents) { |
| 112 for (; it != m_queuedEvents.end(); ++it) { | 112 RefPtrWillBeRawPtr<Event> event = queuedEvent; |
| 113 RefPtrWillBeRawPtr<Event> event = *it; | |
| 114 if (event) | 113 if (event) |
| 115 InspectorInstrumentation::didRemoveEvent(event->target(), event.
get()); | 114 InspectorInstrumentation::didRemoveEvent(event->target(), event.
get()); |
| 116 } | 115 } |
| 117 } | 116 } |
| 118 m_queuedEvents.clear(); | 117 m_queuedEvents.clear(); |
| 119 } | 118 } |
| 120 | 119 |
| 121 void DOMWindowEventQueue::pendingEventTimerFired() | 120 void DOMWindowEventQueue::pendingEventTimerFired() |
| 122 { | 121 { |
| 123 ASSERT(!m_pendingEventTimer->isActive()); | 122 ASSERT(!m_pendingEventTimer->isActive()); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 144 void DOMWindowEventQueue::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) | 143 void DOMWindowEventQueue::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) |
| 145 { | 144 { |
| 146 EventTarget* eventTarget = event->target(); | 145 EventTarget* eventTarget = event->target(); |
| 147 if (eventTarget->toDOMWindow()) | 146 if (eventTarget->toDOMWindow()) |
| 148 eventTarget->toDOMWindow()->dispatchEvent(event, nullptr); | 147 eventTarget->toDOMWindow()->dispatchEvent(event, nullptr); |
| 149 else | 148 else |
| 150 eventTarget->dispatchEvent(event); | 149 eventTarget->dispatchEvent(event); |
| 151 } | 150 } |
| 152 | 151 |
| 153 } | 152 } |
| OLD | NEW |