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

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

Issue 2716853002: (WIP) Worker: Merge ParentFrameTaskRunners into TaskRunnerHelper
Patch Set: WIP Created 3 years, 10 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
deleted file mode 100644
index dc3b11f7cec57aaf0846c3d972aedab3692653b5..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/core/workers/ParentFrameTaskRunners.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// 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/frame/LocalFrame.h"
-#include "public/platform/Platform.h"
-#include "wtf/Assertions.h"
-#include "wtf/ThreadingPrimitives.h"
-
-namespace blink {
-
-ParentFrameTaskRunners::ParentFrameTaskRunners(LocalFrame* frame)
- : ContextLifecycleObserver(frame ? frame->document() : nullptr) {
- if (frame && frame->document())
- DCHECK(frame->document()->isContextThread());
-
- // For now we only support very limited task types.
- for (auto type : {TaskType::UnspecedTimer, TaskType::UnspecedLoading,
- TaskType::Networking, TaskType::PostedMessage,
- TaskType::CanvasBlobSerialization, TaskType::Unthrottled}) {
- m_taskRunners.insert(type, TaskRunnerHelper::get(type, frame));
- }
-}
-
-RefPtr<WebTaskRunner> ParentFrameTaskRunners::get(TaskType type) {
- MutexLocker lock(m_taskRunnersMutex);
- return m_taskRunners.at(type);
-}
-
-DEFINE_TRACE(ParentFrameTaskRunners) {
- ContextLifecycleObserver::trace(visitor);
-}
-
-void ParentFrameTaskRunners::contextDestroyed(ExecutionContext*) {
- MutexLocker lock(m_taskRunnersMutex);
- for (auto& entry : m_taskRunners)
- entry.value = Platform::current()->currentThread()->getWebTaskRunner();
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698