Chromium Code Reviews| 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..9da21466581f5046a8a34fed727ae44663be836c 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,10 @@ void CompositorWorkerGlobalScope::postMessage(ExecutionContext* executionContext |
| int CompositorWorkerGlobalScope::requestAnimationFrame(FrameRequestCallback* callback) |
| { |
| + // For now, just post a task to call mutate on the compositor proxy client. |
|
jbroman
2016/05/09 18:44:18
Please leave a more strongly-worded TODO here so i
flackr
2016/05/10 20:56:13
Done.
|
| + thread()->postTask(BLINK_FROM_HERE, createSameThreadTask(&CompositorProxyClient::triggerMutationForTest, |
|
kinuko
2016/05/09 02:41:26
invoking test-only method from web-facing API and
flackr
2016/05/10 20:56:13
You're right, let's just remove the ForTest and ca
|
| + CompositorProxyClient::from(clients()))); |
| + // TODO(flackr): Signal the compositor to call mutate on the next compositor frame. |
| return m_callbackCollection.registerCallback(callback); |
| } |
| @@ -62,9 +68,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 |