| 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #include "modules/indexeddb/IDBEventDispatcher.h" | 29 #include "modules/indexeddb/IDBEventDispatcher.h" |
| 30 | 30 |
| 31 #include "modules/EventModules.h" | 31 #include "modules/EventModules.h" |
| 32 #include "modules/EventTargetModules.h" | 32 #include "modules/EventTargetModules.h" |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 DispatchEventResult IDBEventDispatcher::dispatch(Event* event, WillBeHeapVector<
RefPtrWillBeMember<EventTarget>>& eventTargets) | 36 DispatchEventResult IDBEventDispatcher::dispatch(Event* event, HeapVector<Member
<EventTarget>>& eventTargets) |
| 37 { | 37 { |
| 38 size_t size = eventTargets.size(); | 38 size_t size = eventTargets.size(); |
| 39 ASSERT(size); | 39 ASSERT(size); |
| 40 | 40 |
| 41 event->setEventPhase(Event::CAPTURING_PHASE); | 41 event->setEventPhase(Event::CAPTURING_PHASE); |
| 42 for (size_t i = size - 1; i; --i) { // Don't do the first element. | 42 for (size_t i = size - 1; i; --i) { // Don't do the first element. |
| 43 event->setCurrentTarget(eventTargets[i].get()); | 43 event->setCurrentTarget(eventTargets[i].get()); |
| 44 eventTargets[i]->fireEventListeners(event); | 44 eventTargets[i]->fireEventListeners(event); |
| 45 if (event->propagationStopped()) | 45 if (event->propagationStopped()) |
| 46 goto doneDispatching; | 46 goto doneDispatching; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 60 goto doneDispatching; | 60 goto doneDispatching; |
| 61 } | 61 } |
| 62 | 62 |
| 63 doneDispatching: | 63 doneDispatching: |
| 64 event->setCurrentTarget(nullptr); | 64 event->setCurrentTarget(nullptr); |
| 65 event->setEventPhase(Event::NONE); | 65 event->setEventPhase(Event::NONE); |
| 66 return EventTarget::dispatchEventResult(*event); | 66 return EventTarget::dispatchEventResult(*event); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace blink | 69 } // namespace blink |
| OLD | NEW |