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

Unified Diff: third_party/WebKit/Source/modules/compositorworker/AbstractAnimationWorkletThread.cpp

Issue 2214263007: [worklets] Split apart CompositorWorkerThread for sharing with AnimationWorkletThread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename abstract class. Created 4 years, 4 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/modules/compositorworker/AbstractAnimationWorkletThread.cpp
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp b/third_party/WebKit/Source/modules/compositorworker/AbstractAnimationWorkletThread.cpp
similarity index 63%
copy from third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp
copy to third_party/WebKit/Source/modules/compositorworker/AbstractAnimationWorkletThread.cpp
index a620087ec8e982ac82266f7f6fabc08251b7096b..c7cd7a861d26757573f485aaffb05f95b681318d 100644
--- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThread.cpp
+++ b/third_party/WebKit/Source/modules/compositorworker/AbstractAnimationWorkletThread.cpp
@@ -1,17 +1,11 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
+// 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 "modules/compositorworker/CompositorWorkerThread.h"
+#include "modules/compositorworker/AbstractAnimationWorkletThread.h"
-#include "bindings/core/v8/V8GCController.h"
-#include "bindings/core/v8/V8Initializer.h"
-#include "core/workers/InProcessWorkerObjectProxy.h"
#include "core/workers/WorkerBackingThread.h"
-#include "core/workers/WorkerThreadStartupData.h"
-#include "modules/compositorworker/CompositorWorkerGlobalScope.h"
#include "platform/CrossThreadFunctional.h"
-#include "platform/TraceEvent.h"
#include "platform/WaitableEvent.h"
#include "platform/WebThreadSupportingGC.h"
#include "public/platform/Platform.h"
@@ -23,7 +17,7 @@ namespace blink {
namespace {
-// This is a singleton class holding the compositor worker thread in this
+// This is a singleton class holding the animation worklet thread in this
// renderer process. BackingThreadHolder::m_thread is cleared by
// ModulesInitializer::shutdown.
// See WorkerThread::terminateAndWaitForAllWorkers for the process shutdown
@@ -107,48 +101,33 @@ BackingThreadHolder* BackingThreadHolder::s_instance = nullptr;
} // namespace
-std::unique_ptr<CompositorWorkerThread> CompositorWorkerThread::create(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, InProcessWorkerObjectProxy& workerObjectProxy, double timeOrigin)
+AbstractAnimationWorkletThread::AbstractAnimationWorkletThread(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, WorkerReportingProxy& workerReportingProxy)
+ : WorkerThread(workerLoaderProxy, workerReportingProxy)
{
- TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "CompositorWorkerThread::create");
- ASSERT(isMainThread());
- return wrapUnique(new CompositorWorkerThread(workerLoaderProxy, workerObjectProxy, timeOrigin));
}
-CompositorWorkerThread::CompositorWorkerThread(PassRefPtr<WorkerLoaderProxy> workerLoaderProxy, InProcessWorkerObjectProxy& workerObjectProxy, double timeOrigin)
- : WorkerThread(workerLoaderProxy, workerObjectProxy)
- , m_workerObjectProxy(workerObjectProxy)
- , m_timeOrigin(timeOrigin)
+AbstractAnimationWorkletThread::~AbstractAnimationWorkletThread()
{
}
-CompositorWorkerThread::~CompositorWorkerThread()
-{
-}
-
-WorkerBackingThread& CompositorWorkerThread::workerBackingThread()
+WorkerBackingThread& AbstractAnimationWorkletThread::workerBackingThread()
{
return *BackingThreadHolder::instance().thread();
}
-WorkerOrWorkletGlobalScope* CompositorWorkerThread::createWorkerGlobalScope(std::unique_ptr<WorkerThreadStartupData> startupData)
-{
- TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), "CompositorWorkerThread::createWorkerGlobalScope");
- return CompositorWorkerGlobalScope::create(this, std::move(startupData), m_timeOrigin);
-}
-
-void CompositorWorkerThread::ensureSharedBackingThread()
+void AbstractAnimationWorkletThread::ensureSharedBackingThread()
{
DCHECK(isMainThread());
BackingThreadHolder::ensureInstance();
}
-void CompositorWorkerThread::clearSharedBackingThread()
+void AbstractAnimationWorkletThread::clearSharedBackingThread()
{
DCHECK(isMainThread());
BackingThreadHolder::clear();
}
-void CompositorWorkerThread::createSharedBackingThreadForTest()
+void AbstractAnimationWorkletThread::createSharedBackingThreadForTest()
{
BackingThreadHolder::createForTest();
}

Powered by Google App Engine
This is Rietveld 408576698