| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); | 416 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); |
| 417 workerGlobalScope->stopActiveDOMObjects(); | 417 workerGlobalScope->stopActiveDOMObjects(); |
| 418 PlatformThreadData::current().threadTimers().setSharedTimer(nullptr); | 418 PlatformThreadData::current().threadTimers().setSharedTimer(nullptr); |
| 419 | 419 |
| 420 // Event listeners would keep DOMWrapperWorld objects alive for too long
. Also, they have references to JS objects, | 420 // Event listeners would keep DOMWrapperWorld objects alive for too long
. Also, they have references to JS objects, |
| 421 // which become dangling once Heap is destroyed. | 421 // which become dangling once Heap is destroyed. |
| 422 workerGlobalScope->removeAllEventListeners(); | 422 workerGlobalScope->removeAllEventListeners(); |
| 423 | 423 |
| 424 // Stick a shutdown command at the end of the queue, so that we deal | 424 // Stick a shutdown command at the end of the queue, so that we deal |
| 425 // with all the cleanup tasks the databases post first. | 425 // with all the cleanup tasks the databases post first. |
| 426 workerGlobalScope->postTask(WorkerThreadShutdownFinishTask::create()); | 426 workerGlobalScope->postTask(FROM_HERE, WorkerThreadShutdownFinishTask::c
reate()); |
| 427 } | 427 } |
| 428 | 428 |
| 429 virtual bool isCleanupTask() const { return true; } | 429 virtual bool isCleanupTask() const { return true; } |
| 430 }; | 430 }; |
| 431 | 431 |
| 432 void WorkerThread::stop() | 432 void WorkerThread::stop() |
| 433 { | 433 { |
| 434 // Prevent the deadlock between GC and an attempt to stop a thread. | 434 // Prevent the deadlock between GC and an attempt to stop a thread. |
| 435 ThreadState::SafePointScope safePointScope(ThreadState::HeapPointersOnStack)
; | 435 ThreadState::SafePointScope safePointScope(ThreadState::HeapPointersOnStack)
; |
| 436 stopInternal(); | 436 stopInternal(); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); | 570 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); |
| 571 } | 571 } |
| 572 | 572 |
| 573 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke
rInspectorController) | 573 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke
rInspectorController) |
| 574 { | 574 { |
| 575 MutexLocker locker(m_workerInspectorControllerMutex); | 575 MutexLocker locker(m_workerInspectorControllerMutex); |
| 576 m_workerInspectorController = workerInspectorController; | 576 m_workerInspectorController = workerInspectorController; |
| 577 } | 577 } |
| 578 | 578 |
| 579 } // namespace blink | 579 } // namespace blink |
| OLD | NEW |