Index: Source/core/workers/WorkerGlobalScope.cpp |
diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp |
index 93b49873f0a2baa982b6628d28d7888a83259213..3afeaf795310e57c785cc5241300f5ee01084675 100644 |
--- a/Source/core/workers/WorkerGlobalScope.cpp |
+++ b/Source/core/workers/WorkerGlobalScope.cpp |
@@ -68,23 +68,6 @@ |
namespace blink { |
-class CloseWorkerGlobalScopeTask : public ExecutionContextTask { |
-public: |
- static PassOwnPtr<CloseWorkerGlobalScopeTask> create() |
- { |
- return adoptPtr(new CloseWorkerGlobalScopeTask); |
- } |
- |
- virtual void performTask(ExecutionContext *context) |
- { |
- WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); |
- // Notify parent that this context is closed. Parent is responsible for calling WorkerThread::stop(). |
- workerGlobalScope->thread()->workerReportingProxy().workerGlobalScopeClosed(); |
- } |
- |
- virtual bool isCleanupTask() const { return true; } |
-}; |
- |
WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, WorkerThread* thread, double timeOrigin, const SecurityOrigin* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) |
: m_url(url) |
, m_userAgent(userAgent) |
@@ -176,14 +159,8 @@ WorkerLocation* WorkerGlobalScope::location() const |
void WorkerGlobalScope::close() |
{ |
- if (m_closing) |
- return; |
- |
- // Let current script run to completion but prevent future script evaluations. |
- // After m_closing is set, all the tasks in the queue continue to be fetched but only |
- // tasks with isCleanupTask()==true will be executed. |
+ // Let current script run to completion, but tell the worker thread to shut down after the script exits. |
m_closing = true; |
- postTask(FROM_HERE, CloseWorkerGlobalScopeTask::create()); |
} |
WorkerConsole* WorkerGlobalScope::console() |