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

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

Issue 2402983002: [TimeZoneMonitor] Decouple renderer side impl from content to blink. (Closed)
Patch Set: Create blink::WorkerThread::PostTaskToAllWorkerThreads helper function Created 4 years, 2 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/WorkerThread.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
index f03dfb3508ee3a50d82574df321b0017c5fc9281..3b4554bace4b3c9ab95ed8be1ea38e5816b43036 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -320,6 +320,18 @@ unsigned WorkerThread::workerThreadCount() {
return workerThreads().size();
}
+void WorkerThread::PostTaskToAllWorkerThreads(
+ const WebTraceLocation& location,
+ std::unique_ptr<ExecutionContextTask> task) {
+ MutexLocker lock(threadSetMutex());
+ HashSet<WorkerThread*> threads = workerThreads();
+
+ for (WorkerThread* thread : threads) {
+ if (thread->isOwningBackingThread())
+ thread->postTask(location, std::move(task));
+ }
+}
+
PlatformThreadId WorkerThread::platformThreadId() {
if (!m_requestedToStart)
return 0;

Powered by Google App Engine
This is Rietveld 408576698