Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2023)

Unified Diff: Source/core/workers/WorkerContext.cpp

Issue 16988003: Revert "Extract ContextLifecycleNotifier from ScriptExecutionContext." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/workers/WorkerContext.h ('k') | Source/modules/webdatabase/DatabaseContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « Source/core/workers/WorkerContext.h ('k') | Source/modules/webdatabase/DatabaseContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698