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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 class WorkerThreadShutdownStartTask : public ExecutionContextTask { | 197 class WorkerThreadShutdownStartTask : public ExecutionContextTask { |
198 public: | 198 public: |
199 static PassOwnPtr<WorkerThreadShutdownStartTask> create() | 199 static PassOwnPtr<WorkerThreadShutdownStartTask> create() |
200 { | 200 { |
201 return adoptPtr(new WorkerThreadShutdownStartTask()); | 201 return adoptPtr(new WorkerThreadShutdownStartTask()); |
202 } | 202 } |
203 | 203 |
204 virtual void performTask(ExecutionContext *context) | 204 virtual void performTask(ExecutionContext *context) |
205 { | 205 { |
206 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); | 206 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); |
207 | 207 workerGlobalScope->stopFetch(); |
208 workerGlobalScope->stopActiveDOMObjects(); | 208 workerGlobalScope->stopActiveDOMObjects(); |
209 | 209 |
210 // Event listeners would keep DOMWrapperWorld objects alive for too long
. Also, they have references to JS objects, | 210 // Event listeners would keep DOMWrapperWorld objects alive for too long
. Also, they have references to JS objects, |
211 // which become dangling once Heap is destroyed. | 211 // which become dangling once Heap is destroyed. |
212 workerGlobalScope->removeAllEventListeners(); | 212 workerGlobalScope->removeAllEventListeners(); |
213 | 213 |
214 // Stick a shutdown command at the end of the queue, so that we deal | 214 // Stick a shutdown command at the end of the queue, so that we deal |
215 // with all the cleanup tasks the databases post first. | 215 // with all the cleanup tasks the databases post first. |
216 workerGlobalScope->postTask(WorkerThreadShutdownFinishTask::create()); | 216 workerGlobalScope->postTask(WorkerThreadShutdownFinishTask::create()); |
217 } | 217 } |
(...skipping 22 matching lines...) Expand all Loading... |
240 } | 240 } |
241 m_runLoop.terminate(); | 241 m_runLoop.terminate(); |
242 } | 242 } |
243 | 243 |
244 bool WorkerThread::isCurrentThread() const | 244 bool WorkerThread::isCurrentThread() const |
245 { | 245 { |
246 return m_threadID == currentThread(); | 246 return m_threadID == currentThread(); |
247 } | 247 } |
248 | 248 |
249 } // namespace WebCore | 249 } // namespace WebCore |
OLD | NEW |