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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerThreadLifecycleObserver.cpp

Issue 2025783002: Worker: Introduce an observation mechanism for WorkerThread termination (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@delayed_task
Patch Set: maybe fix tests Created 4 years, 7 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
Index: third_party/WebKit/Source/core/workers/WorkerThreadLifecycleObserver.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerThreadLifecycleObserver.cpp b/third_party/WebKit/Source/core/workers/WorkerThreadLifecycleObserver.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5e42591c586bf969326d564d0c44062163fee372
--- /dev/null
+++ b/third_party/WebKit/Source/core/workers/WorkerThreadLifecycleObserver.cpp
@@ -0,0 +1,19 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/workers/WorkerThreadLifecycleObserver.h"
+
+#include "core/workers/WorkerThread.h"
+
+namespace blink {
+
+WorkerThreadLifecycleObserver::WorkerThreadLifecycleObserver(WorkerThread* workerThread)
+ : LifecycleObserver(workerThread->workerThreadContext()) { }
+
+bool WorkerThreadLifecycleObserver::isWorkerThreadTerminated() const
+{
+ return !lifecycleContext();
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698