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

Unified Diff: third_party/WebKit/Source/web/CompositorWorkerProxyClientImpl.cpp

Issue 2515363002: Introduce AnimationWorkletProxyClient and necessary plumbing to get it in worklet messaging proxy. (Closed)
Patch Set: Remove unnecessary PLATFORM_EXPORT 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/web/CompositorWorkerProxyClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp b/third_party/WebKit/Source/web/CompositorWorkerProxyClientImpl.cpp
similarity index 67%
rename from third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp
rename to third_party/WebKit/Source/web/CompositorWorkerProxyClientImpl.cpp
index b9c3e9bf3f250e66c987650915e4ace97be97396..1e7f1495f58d46652b384228156e8a4387046c69 100644
--- a/third_party/WebKit/Source/web/CompositorProxyClientImpl.cpp
+++ b/third_party/WebKit/Source/web/CompositorWorkerProxyClientImpl.cpp
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "web/CompositorProxyClientImpl.h"
+#include "web/CompositorWorkerProxyClientImpl.h"
#include "core/dom/CompositorProxy.h"
#include "modules/compositorworker/CompositorWorkerGlobalScope.h"
@@ -25,9 +25,10 @@ class ScopedCompositorMutableState final {
HeapHashSet<WeakMember<CompositorProxy>>& proxies,
CompositorMutableStateProvider* stateProvider)
: m_proxies(proxies) {
- for (CompositorProxy* proxy : m_proxies)
+ for (CompositorProxy* proxy : m_proxies) {
proxy->takeCompositorMutableState(
stateProvider->getMutableStateFor(proxy->elementId()));
+ }
}
~ScopedCompositorMutableState() {
for (CompositorProxy* proxy : m_proxies)
@@ -38,50 +39,51 @@ class ScopedCompositorMutableState final {
HeapHashSet<WeakMember<CompositorProxy>>& m_proxies;
};
-CompositorProxyClientImpl::CompositorProxyClientImpl(
+CompositorWorkerProxyClientImpl::CompositorWorkerProxyClientImpl(
CompositorMutatorImpl* mutator)
: m_mutator(mutator), m_globalScope(nullptr) {
DCHECK(isMainThread());
}
-DEFINE_TRACE(CompositorProxyClientImpl) {
- CompositorProxyClient::trace(visitor);
+DEFINE_TRACE(CompositorWorkerProxyClientImpl) {
visitor->trace(m_proxies);
+ CompositorAnimator::trace(visitor);
+ CompositorWorkerProxyClient::trace(visitor);
}
-void CompositorProxyClientImpl::setGlobalScope(WorkerGlobalScope* scope) {
+void CompositorWorkerProxyClientImpl::setGlobalScope(WorkerGlobalScope* scope) {
TRACE_EVENT0("compositor-worker",
- "CompositorProxyClientImpl::setGlobalScope");
+ "CompositorWorkerProxyClientImpl::setGlobalScope");
DCHECK(!m_globalScope);
DCHECK(scope);
m_globalScope = static_cast<CompositorWorkerGlobalScope*>(scope);
- m_mutator->registerProxyClient(this);
+ m_mutator->registerCompositorAnimator(this);
}
-void CompositorProxyClientImpl::dispose() {
- // CompositorProxyClientImpl and CompositorMutatorImpl form a reference
- // cycle. CompositorWorkerGlobalScope and CompositorProxyClientImpl
+void CompositorWorkerProxyClientImpl::dispose() {
+ // CompositorWorkerProxyClientImpl and CompositorMutatorImpl form a reference
+ // cycle. CompositorWorkerGlobalScope and CompositorWorkerProxyClientImpl
// also form another big reference cycle. So dispose needs to be called on
// Worker termination to break these cycles. If not, layout test leak
// detection will report a WorkerGlobalScope leak.
- m_mutator->unregisterProxyClient(this);
+ m_mutator->unregisterCompositorAnimator(this);
m_globalScope = nullptr;
}
-void CompositorProxyClientImpl::requestAnimationFrame() {
+void CompositorWorkerProxyClientImpl::requestAnimationFrame() {
TRACE_EVENT0("compositor-worker",
- "CompositorProxyClientImpl::requestAnimationFrame");
+ "CompositorWorkerProxyClientImpl::requestAnimationFrame");
m_requestedAnimationFrameCallbacks = true;
m_mutator->setNeedsMutate();
}
-bool CompositorProxyClientImpl::mutate(
+bool CompositorWorkerProxyClientImpl::mutate(
double monotonicTimeNow,
CompositorMutableStateProvider* stateProvider) {
if (!m_globalScope)
return false;
- TRACE_EVENT0("compositor-worker", "CompositorProxyClientImpl::mutate");
+ TRACE_EVENT0("compositor-worker", "CompositorWorkerProxyClientImpl::mutate");
if (!m_requestedAnimationFrameCallbacks)
return false;
@@ -94,10 +96,11 @@ bool CompositorProxyClientImpl::mutate(
return m_requestedAnimationFrameCallbacks;
}
-bool CompositorProxyClientImpl::executeAnimationFrameCallbacks(
+bool CompositorWorkerProxyClientImpl::executeAnimationFrameCallbacks(
double monotonicTimeNow) {
- TRACE_EVENT0("compositor-worker",
- "CompositorProxyClientImpl::executeAnimationFrameCallbacks");
+ TRACE_EVENT0(
+ "compositor-worker",
+ "CompositorWorkerProxyClientImpl::executeAnimationFrameCallbacks");
DCHECK(m_globalScope);
// Convert to zero based document time in milliseconds consistent with
@@ -107,12 +110,12 @@ bool CompositorProxyClientImpl::executeAnimationFrameCallbacks(
return m_globalScope->executeAnimationFrameCallbacks(highResTimeMs);
}
-void CompositorProxyClientImpl::registerCompositorProxy(
+void CompositorWorkerProxyClientImpl::registerCompositorProxy(
CompositorProxy* proxy) {
m_proxies.insert(proxy);
}
-void CompositorProxyClientImpl::unregisterCompositorProxy(
+void CompositorWorkerProxyClientImpl::unregisterCompositorProxy(
CompositorProxy* proxy) {
m_proxies.remove(proxy);
}
« no previous file with comments | « third_party/WebKit/Source/web/CompositorWorkerProxyClientImpl.h ('k') | third_party/WebKit/Source/web/WebFrameWidgetBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698