| Index: Source/core/workers/WorkerContext.cpp
|
| diff --git a/Source/core/workers/WorkerContext.cpp b/Source/core/workers/WorkerContext.cpp
|
| index 3a6d89108a00270c40a47f4e577dd318b4218434..e6b5010c19fa374b334b2f89a7594a65cde5b354 100644
|
| --- a/Source/core/workers/WorkerContext.cpp
|
| +++ b/Source/core/workers/WorkerContext.cpp
|
| @@ -35,7 +35,6 @@
|
| #include "bindings/v8/ScriptSourceCode.h"
|
| #include "bindings/v8/ScriptValue.h"
|
| #include "core/dom/ActiveDOMObject.h"
|
| -#include "core/dom/ContextLifecycleNotifier.h"
|
| #include "core/dom/ErrorEvent.h"
|
| #include "core/dom/Event.h"
|
| #include "core/dom/MessagePort.h"
|
| @@ -176,6 +175,23 @@ WorkerNavigator* WorkerContext::navigator() const
|
| return m_navigator.get();
|
| }
|
|
|
| +bool WorkerContext::hasPendingActivity() const
|
| +{
|
| + ActiveDOMObjectsSet::const_iterator activeObjectsEnd = activeDOMObjects().end();
|
| + for (ActiveDOMObjectsSet::const_iterator iter = activeDOMObjects().begin(); iter != activeObjectsEnd; ++iter) {
|
| + if ((*iter)->hasPendingActivity())
|
| + return true;
|
| + }
|
| +
|
| + HashSet<MessagePort*>::const_iterator messagePortsEnd = messagePorts().end();
|
| + for (HashSet<MessagePort*>::const_iterator iter = messagePorts().begin(); iter != messagePortsEnd; ++iter) {
|
| + if ((*iter)->hasPendingActivity())
|
| + return true;
|
| + }
|
| +
|
| + return false;
|
| +}
|
| +
|
| void WorkerContext::postTask(PassOwnPtr<Task> task)
|
| {
|
| thread()->runLoop().postTask(task);
|
|
|