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 aa495efd7e60256c7eac965fc58fd83a8012af16..543984210fa4c993e24c93f8d84a5e4a6627a913 100644 |
--- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp |
+++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp |
@@ -23,8 +23,11 @@ PassRefPtrWillBeRawPtr<CompositorWorkerGlobalScope> CompositorWorkerGlobalScope: |
CompositorWorkerGlobalScope::CompositorWorkerGlobalScope(const KURL& url, const String& userAgent, CompositorWorkerThread* thread, double timeOrigin, PassOwnPtr<SecurityOrigin::PrivilegeData> starterOriginPrivilegeData, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) |
: WorkerGlobalScope(url, userAgent, thread, timeOrigin, starterOriginPrivilegeData, workerClients) |
+ , m_executingAnimationFrameCallbacks(false) |
, m_callbackCollection(this) |
+ , m_client(CompositorProxyClient::from(clients())) |
{ |
+ m_client->setGlobalScope(this); |
} |
CompositorWorkerGlobalScope::~CompositorWorkerGlobalScope() |
@@ -53,6 +56,9 @@ void CompositorWorkerGlobalScope::postMessage(ExecutionContext* executionContext |
int CompositorWorkerGlobalScope::requestAnimationFrame(FrameRequestCallback* callback) |
{ |
+ const bool shouldSignal = !m_executingAnimationFrameCallbacks && m_callbackCollection.isEmpty(); |
+ if (shouldSignal) |
+ m_client->requestMutation(); |
return m_callbackCollection.registerCallback(callback); |
} |
@@ -61,9 +67,11 @@ void CompositorWorkerGlobalScope::cancelAnimationFrame(int id) |
m_callbackCollection.cancelCallback(id); |
} |
-void CompositorWorkerGlobalScope::executeAnimationFrameCallbacks(double highResTimeNow) |
+bool CompositorWorkerGlobalScope::executeAnimationFrameCallbacks(double highResTimeNow) |
{ |
+ TemporaryChange<bool> temporaryChange(m_executingAnimationFrameCallbacks, true); |
m_callbackCollection.executeCallbacks(highResTimeNow, highResTimeNow); |
+ return !m_callbackCollection.isEmpty(); |
} |
CompositorWorkerThread* CompositorWorkerGlobalScope::thread() const |