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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 EventQueue::trace(visitor); | 59 EventQueue::trace(visitor); |
60 } | 60 } |
61 | 61 |
62 class WorkerEventQueue::EventDispatcherTask : public ExecutionContextTask { | 62 class WorkerEventQueue::EventDispatcherTask : public ExecutionContextTask { |
63 public: | 63 public: |
64 static PassOwnPtr<EventDispatcherTask> create(PassRefPtrWillBeRawPtr<Event>
event, WorkerEventQueue* eventQueue) | 64 static PassOwnPtr<EventDispatcherTask> create(PassRefPtrWillBeRawPtr<Event>
event, WorkerEventQueue* eventQueue) |
65 { | 65 { |
66 return adoptPtr(new EventDispatcherTask(event, eventQueue)); | 66 return adoptPtr(new EventDispatcherTask(event, eventQueue)); |
67 } | 67 } |
68 | 68 |
69 virtual ~EventDispatcherTask() | 69 ~EventDispatcherTask() override |
70 { | 70 { |
71 if (m_event) | 71 if (m_event) |
72 m_eventQueue->removeEvent(m_event.get()); | 72 m_eventQueue->removeEvent(m_event.get()); |
73 } | 73 } |
74 | 74 |
75 void dispatchEvent(ExecutionContext*, PassRefPtrWillBeRawPtr<Event> event) | 75 void dispatchEvent(ExecutionContext*, PassRefPtrWillBeRawPtr<Event> event) |
76 { | 76 { |
77 event->target()->dispatchEvent(event); | 77 event->target()->dispatchEvent(event); |
78 } | 78 } |
79 | 79 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 for (const auto& entry : m_eventTaskMap) { | 139 for (const auto& entry : m_eventTaskMap) { |
140 Event* event = entry.key.get(); | 140 Event* event = entry.key.get(); |
141 EventDispatcherTask* task = entry.value; | 141 EventDispatcherTask* task = entry.value; |
142 InspectorInstrumentation::didRemoveEvent(event->target(), event); | 142 InspectorInstrumentation::didRemoveEvent(event->target(), event); |
143 task->cancel(); | 143 task->cancel(); |
144 } | 144 } |
145 m_eventTaskMap.clear(); | 145 m_eventTaskMap.clear(); |
146 } | 146 } |
147 | 147 |
148 } | 148 } |
OLD | NEW |