Index: WebCore/bindings/v8/WorkerScriptController.cpp |
=================================================================== |
--- WebCore/bindings/v8/WorkerScriptController.cpp (revision 109601) |
+++ WebCore/bindings/v8/WorkerScriptController.cpp (working copy) |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2009 Google Inc. All rights reserved. |
+ * Copyright (C) 2012 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -53,6 +53,7 @@ |
: m_workerContext(workerContext) |
, m_isolate(v8::Isolate::New()) |
, m_executionForbidden(false) |
+ , m_executionScheduledToTerminate(false) |
{ |
V8BindingPerIsolateData* data = V8BindingPerIsolateData::create(m_isolate); |
data->allStores().append(&m_DOMDataStore); |
@@ -92,9 +93,19 @@ |
void WorkerScriptController::scheduleExecutionTermination() |
{ |
+ { |
+ MutexLocker locker(m_scheduledTerminationMutex); |
+ m_executionScheduledToTerminate = true; |
+ } |
v8::V8::TerminateExecution(m_isolate); |
} |
+bool WorkerScriptController::isExecutionTerminating() const |
+{ |
+ MutexLocker locker(m_scheduledTerminationMutex); |
+ return m_executionScheduledToTerminate; |
+} |
+ |
void WorkerScriptController::forbidExecution() |
{ |
ASSERT(m_workerContext->isContextThread()); |