| 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 22 matching lines...) Expand all Loading... |
| 33 #include "core/inspector/InspectorInstrumentation.h" | 33 #include "core/inspector/InspectorInstrumentation.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class DOMWindowEventQueueTimer final : public NoBaseWillBeGarbageCollectedFinali
zed<DOMWindowEventQueueTimer>, public SuspendableTimer { | 37 class DOMWindowEventQueueTimer final : public NoBaseWillBeGarbageCollectedFinali
zed<DOMWindowEventQueueTimer>, public SuspendableTimer { |
| 38 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMWindowEventQueueTimer); | 38 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMWindowEventQueueTimer); |
| 39 WTF_MAKE_NONCOPYABLE(DOMWindowEventQueueTimer); | 39 WTF_MAKE_NONCOPYABLE(DOMWindowEventQueueTimer); |
| 40 public: | 40 public: |
| 41 DOMWindowEventQueueTimer(DOMWindowEventQueue* eventQueue, ExecutionContext*
context) | 41 DOMWindowEventQueueTimer(DOMWindowEventQueue* eventQueue, ExecutionContext*
context) |
| 42 : SuspendableTimer(context) | 42 : SuspendableTimer(context) |
| 43 , m_eventQueue(eventQueue) { } | 43 , m_eventQueue(eventQueue) |
| 44 { |
| 45 } |
| 46 |
| 47 // Eager finalization is needed to promptly stop this timer object. |
| 48 // (see DOMTimer comment for more.) |
| 49 EAGERLY_FINALIZE(); |
| 44 DEFINE_INLINE_VIRTUAL_TRACE() | 50 DEFINE_INLINE_VIRTUAL_TRACE() |
| 45 { | 51 { |
| 46 visitor->trace(m_eventQueue); | 52 visitor->trace(m_eventQueue); |
| 47 SuspendableTimer::trace(visitor); | 53 SuspendableTimer::trace(visitor); |
| 48 } | 54 } |
| 49 | 55 |
| 50 private: | 56 private: |
| 51 virtual void fired() { m_eventQueue->pendingEventTimerFired(); } | 57 virtual void fired() { m_eventQueue->pendingEventTimerFired(); } |
| 52 | 58 |
| 53 RawPtrWillBeMember<DOMWindowEventQueue> m_eventQueue; | 59 RawPtrWillBeMember<DOMWindowEventQueue> m_eventQueue; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 void DOMWindowEventQueue::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) | 154 void DOMWindowEventQueue::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) |
| 149 { | 155 { |
| 150 EventTarget* eventTarget = event->target(); | 156 EventTarget* eventTarget = event->target(); |
| 151 if (eventTarget->toDOMWindow()) | 157 if (eventTarget->toDOMWindow()) |
| 152 eventTarget->toDOMWindow()->dispatchEvent(event, nullptr); | 158 eventTarget->toDOMWindow()->dispatchEvent(event, nullptr); |
| 153 else | 159 else |
| 154 eventTarget->dispatchEvent(event); | 160 eventTarget->dispatchEvent(event); |
| 155 } | 161 } |
| 156 | 162 |
| 157 } | 163 } |
| OLD | NEW |