Chromium Code Reviews| Index: third_party/WebKit/Source/web/CompositorProxyClientImpl.h |
| diff --git a/third_party/WebKit/Source/web/CompositorProxyClientImpl.h b/third_party/WebKit/Source/web/CompositorProxyClientImpl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3794ec1df1f0735a7481b69ba0357c4c859a88cb |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/web/CompositorProxyClientImpl.h |
| @@ -0,0 +1,48 @@ |
| +// Copyright 2015 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. |
| + |
| +#ifndef CompositorProxyClientImpl_h |
| +#define CompositorProxyClientImpl_h |
| + |
| +#include "core/dom/CompositorProxyClient.h" |
| +#include "wtf/Noncopyable.h" |
| + |
| +namespace blink { |
| + |
| +class CompositorMutatorImpl; |
| +class CompositorWorkerGlobalScope; |
| +class WorkerGlobalScope; |
| + |
| +// Mediates between one CompositorWorkerGlobalScope and the associated CompositorMutatorImpl. |
| +// There is one CompositorProxyClientImpl per worker but there may be multiple for a given |
| +// mutator, e.g. if a single document creates multiple CompositorWorker objects. |
| +// |
| +// Should be accessed only on the compositor thread. |
| +class CompositorProxyClientImpl final : public GarbageCollected<CompositorProxyClientImpl>, public CompositorProxyClient { |
| + USING_GARBAGE_COLLECTED_MIXIN(CompositorProxyClientImpl); |
| + WTF_MAKE_NONCOPYABLE(CompositorProxyClientImpl); |
| +public: |
| + CompositorProxyClientImpl(CompositorMutatorImpl*); |
| + DECLARE_VIRTUAL_TRACE(); |
| + |
| + // Runs the animation frame callback for the frame starting at the given time. |
| + // Returns true if another animation frame was requested (i.e. should be reinvoked next frame). |
| + bool mutate(double monotonicTimeNow); |
| + |
| + // CompositorProxyClient: |
| + void setGlobalScope(WorkerGlobalScope*) override; |
| + void requestAnimationFrame() override; |
| + |
| +private: |
| + bool executeAnimationFrameCallbacks(double monotonicTimeNow); |
| + |
| + WeakMember<CompositorMutatorImpl> m_mutator; |
|
jbroman
2016/05/04 17:59:00
Should this be a weak member? It's used without nu
flackr
2016/05/04 21:52:41
Seems fine to me, this should definitely be gone b
|
| + |
| + WeakMember<CompositorWorkerGlobalScope> m_globalScope; |
|
jbroman
2016/05/04 17:59:00
Writing the above comment has made me wonder wheth
flackr
2016/05/04 21:52:41
Done. This doesn't need to be weak either. In fact
|
| + bool m_requestedAnimationFrameCallbacks; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // CompositorProxyClientImpl_h |