| Index: third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp
|
| diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp
|
| index 38f958c7f366a1c3106d8af1cb3f3323c277d9be..d660f90cc768e4e0e1d986858c61e332b17bc914 100644
|
| --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp
|
| +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp
|
| @@ -24,8 +24,10 @@ CompositorWorkerGlobalScope* CompositorWorkerGlobalScope::create(CompositorWorke
|
|
|
| CompositorWorkerGlobalScope::CompositorWorkerGlobalScope(const KURL& url, const String& userAgent, CompositorWorkerThread* thread, double timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData> starterOriginPrivilegeData, WorkerClients* workerClients)
|
| : WorkerGlobalScope(url, userAgent, thread, timeOrigin, std::move(starterOriginPrivilegeData), workerClients)
|
| + , m_executingAnimationFrameCallbacks(false)
|
| , m_callbackCollection(this)
|
| {
|
| + CompositorProxyClient::from(clients())->setGlobalScope(this);
|
| }
|
|
|
| CompositorWorkerGlobalScope::~CompositorWorkerGlobalScope()
|
| @@ -54,6 +56,9 @@ void CompositorWorkerGlobalScope::postMessage(ExecutionContext* executionContext
|
|
|
| int CompositorWorkerGlobalScope::requestAnimationFrame(FrameRequestCallback* callback)
|
| {
|
| + const bool shouldSignal = !m_executingAnimationFrameCallbacks && m_callbackCollection.isEmpty();
|
| + if (shouldSignal)
|
| + CompositorProxyClient::from(clients())->requestAnimationFrame();
|
| return m_callbackCollection.registerCallback(callback);
|
| }
|
|
|
| @@ -62,9 +67,11 @@ void CompositorWorkerGlobalScope::cancelAnimationFrame(int id)
|
| m_callbackCollection.cancelCallback(id);
|
| }
|
|
|
| -void CompositorWorkerGlobalScope::executeAnimationFrameCallbacks(double highResTimeNow)
|
| +bool CompositorWorkerGlobalScope::executeAnimationFrameCallbacks(double highResTimeMs)
|
| {
|
| - m_callbackCollection.executeCallbacks(highResTimeNow, highResTimeNow);
|
| + TemporaryChange<bool> temporaryChange(m_executingAnimationFrameCallbacks, true);
|
| + m_callbackCollection.executeCallbacks(highResTimeMs, highResTimeMs);
|
| + return !m_callbackCollection.isEmpty();
|
| }
|
|
|
| CompositorWorkerThread* CompositorWorkerGlobalScope::thread() const
|
|
|