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

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

Issue 2163983004: Pass per-frame task runners to Workers (when possible) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 5 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/ParentFrameTaskRunners.cpp
diff --git a/third_party/WebKit/Source/core/workers/ParentFrameTaskRunners.cpp b/third_party/WebKit/Source/core/workers/ParentFrameTaskRunners.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..10350aefdf6df7a88054a37bd940b4915819b2b3
--- /dev/null
+++ b/third_party/WebKit/Source/core/workers/ParentFrameTaskRunners.cpp
@@ -0,0 +1,40 @@
+// 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/ParentFrameTaskRunners.h"
+
+#include "core/dom/Document.h"
+#include "core/dom/TaskRunnerHelper.h"
+#include "wtf/Assertions.h"
+
+namespace blink {
+
+ParentFrameTaskRunners::~ParentFrameTaskRunners()
+{
+}
+
+WebTaskRunner* ParentFrameTaskRunners::getUnthrottledTaskRunner()
+{
+ return m_unthrottledTaskRunner.get();
+}
+
+WebTaskRunner* ParentFrameTaskRunners::getTimerTaskRunner()
+{
+ return m_timerTaskRunner.get();
+}
+
+WebTaskRunner* ParentFrameTaskRunners::getLoadingTaskRunner()
+{
+ return m_loadingTaskRunner.get();
+}
+
+ParentFrameTaskRunners::ParentFrameTaskRunners(Document* document)
+ : m_unthrottledTaskRunner(TaskRunnerHelper::getUnthrottledTaskRunner(document)->clone())
+ , m_timerTaskRunner(TaskRunnerHelper::getTimerTaskRunner(document)->clone())
+ , m_loadingTaskRunner(TaskRunnerHelper::getLoadingTaskRunner(document)->clone())
+{
+ DCHECK(document->isContextThread());
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/workers/ParentFrameTaskRunners.h ('k') | third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698