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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 void WorkerGlobalScope::close() | 177 void WorkerGlobalScope::close() |
178 { | 178 { |
179 if (m_closing) | 179 if (m_closing) |
180 return; | 180 return; |
181 | 181 |
182 // Let current script run to completion but prevent future script evaluation
s. | 182 // Let current script run to completion but prevent future script evaluation
s. |
183 // After m_closing is set, all the tasks in the queue continue to be fetched
but only | 183 // After m_closing is set, all the tasks in the queue continue to be fetched
but only |
184 // tasks with isCleanupTask()==true will be executed. | 184 // tasks with isCleanupTask()==true will be executed. |
185 m_closing = true; | 185 m_closing = true; |
| 186 m_thread->preShutdown(); |
186 postTask(FROM_HERE, CloseWorkerGlobalScopeTask::create()); | 187 postTask(FROM_HERE, CloseWorkerGlobalScopeTask::create()); |
187 } | 188 } |
188 | 189 |
189 WorkerConsole* WorkerGlobalScope::console() | 190 WorkerConsole* WorkerGlobalScope::console() |
190 { | 191 { |
191 if (!m_console) | 192 if (!m_console) |
192 m_console = WorkerConsole::create(this); | 193 m_console = WorkerConsole::create(this); |
193 return m_console.get(); | 194 return m_console.get(); |
194 } | 195 } |
195 | 196 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 visitor->trace(m_timers); | 397 visitor->trace(m_timers); |
397 visitor->trace(m_messageStorage); | 398 visitor->trace(m_messageStorage); |
398 visitor->trace(m_pendingMessages); | 399 visitor->trace(m_pendingMessages); |
399 HeapSupplementable<WorkerGlobalScope>::trace(visitor); | 400 HeapSupplementable<WorkerGlobalScope>::trace(visitor); |
400 #endif | 401 #endif |
401 ExecutionContext::trace(visitor); | 402 ExecutionContext::trace(visitor); |
402 EventTargetWithInlineData::trace(visitor); | 403 EventTargetWithInlineData::trace(visitor); |
403 } | 404 } |
404 | 405 |
405 } // namespace blink | 406 } // namespace blink |
OLD | NEW |