OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 void WorkerGlobalScope::wasRequestedToTerminate() | 202 void WorkerGlobalScope::wasRequestedToTerminate() |
203 { | 203 { |
204 if (m_terminationObserver) | 204 if (m_terminationObserver) |
205 m_terminationObserver->wasRequestedToTerminate(); | 205 m_terminationObserver->wasRequestedToTerminate(); |
206 } | 206 } |
207 | 207 |
208 void WorkerGlobalScope::dispose() | 208 void WorkerGlobalScope::dispose() |
209 { | 209 { |
210 ASSERT(thread()->isCurrentThread()); | 210 ASSERT(thread()->isCurrentThread()); |
211 | 211 |
| 212 m_eventQueue->close(); |
212 clearScript(); | 213 clearScript(); |
213 clearInspector(); | 214 clearInspector(); |
214 setClient(0); | 215 setClient(0); |
215 | 216 |
216 // We do not clear the thread field of the | 217 // We do not clear the thread field of the |
217 // WorkerGlobalScope. Other objects keep the worker global scope | 218 // WorkerGlobalScope. Other objects keep the worker global scope |
218 // alive because they need its thread field to check that work is | 219 // alive because they need its thread field to check that work is |
219 // being carried out on the right thread. We therefore cannot clear | 220 // being carried out on the right thread. We therefore cannot clear |
220 // the thread field before all references to the worker global | 221 // the thread field before all references to the worker global |
221 // scope are gone. | 222 // scope are gone. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 WorkerEventQueue* WorkerGlobalScope::eventQueue() const | 319 WorkerEventQueue* WorkerGlobalScope::eventQueue() const |
319 { | 320 { |
320 return m_eventQueue.get(); | 321 return m_eventQueue.get(); |
321 } | 322 } |
322 | 323 |
323 void WorkerGlobalScope::trace(Visitor* visitor) | 324 void WorkerGlobalScope::trace(Visitor* visitor) |
324 { | 325 { |
325 visitor->trace(m_console); | 326 visitor->trace(m_console); |
326 visitor->trace(m_location); | 327 visitor->trace(m_location); |
327 visitor->trace(m_navigator); | 328 visitor->trace(m_navigator); |
| 329 visitor->trace(m_eventQueue); |
328 visitor->trace(m_workerClients); | 330 visitor->trace(m_workerClients); |
329 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); | 331 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); |
330 ExecutionContext::trace(visitor); | 332 ExecutionContext::trace(visitor); |
331 EventTargetWithInlineData::trace(visitor); | 333 EventTargetWithInlineData::trace(visitor); |
332 } | 334 } |
333 | 335 |
334 } // namespace WebCore | 336 } // namespace WebCore |
OLD | NEW |