Chromium Code Reviews| Index: third_party/WebKit/Source/web/CompositorMutatorImpl.h |
| diff --git a/third_party/WebKit/Source/web/CompositorMutatorImpl.h b/third_party/WebKit/Source/web/CompositorMutatorImpl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..99035737d8dece6c1539808025cf14ff0bd24de3 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/web/CompositorMutatorImpl.h |
| @@ -0,0 +1,65 @@ |
| +// Copyright 2016 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 CompositorMutatorImpl_h |
| +#define CompositorMutatorImpl_h |
| + |
| +#include "platform/graphics/CompositorMutator.h" |
| +#include "platform/heap/Handle.h" |
| +#include "wtf/Noncopyable.h" |
| +#include "wtf/OwnPtr.h" |
| +#include "wtf/PassOwnPtr.h" |
| + |
| +#include <set> |
| + |
| +namespace blink { |
| + |
| +class CompositorProxy; |
| +class CompositorProxyClient; |
| +class CompositorWorkerGlobalScope; |
| +class CompositorMutatorClient; |
| +class CustomCompositorAnimationManager; |
| +class WaitableEvent; |
| + |
| +class CompositorMutatorImpl final : public CompositorMutator { |
|
jbroman
2016/04/20 19:24:51
It sounds like there are threading concerns with t
|
| + WTF_MAKE_NONCOPYABLE(CompositorMutatorImpl); |
| + |
| +public: |
| + static PassOwnPtr<CompositorMutatorImpl> create(); |
| + ~CompositorMutatorImpl() override; |
| + |
| + // CompositorMutator implementation. |
| + bool mutate(double timeNow) override; |
| + |
| + void registerClient(CompositorProxyClient*); |
|
jbroman
2016/04/20 21:06:42
nit: This name is confusing given that client() al
flackr
2016/04/25 14:06:28
Done and done.
|
| + void unregisterClient(CompositorProxyClient*); |
| + |
| + CompositorProxyClient* createCompositorProxyClient(); |
|
jbroman
2016/04/20 21:06:42
What value does this function add, compared caller
flackr
2016/04/25 14:06:28
Doesn't seem to be adding any value. I've moved th
|
| + CompositorMutatorClient* client() { return m_client.get(); } |
| + |
| + void setNeedsMutate(); |
| + |
| +private: |
| + CompositorMutatorImpl(); |
| + |
| + // We use a standard container instead of oil-pan wtf ones as |
| + // the latter seems to mess up oil-pan garbage collection. I believe this is |
| + // due to the multi-threaded situation and the fact that CC thread does not |
| + // participate in oil-pan GC. |
| + // This should not be an issue, as the pointer does not need to be traced |
| + // here because the CompositorProxyClientImpl lifetime is already managed by |
| + // oilpan and we update the Set ourself via register/unregister and do not |
| + // need oilpan to take any extra actions. |
| + // TODO(majidvp): Look into details to see why we crash if |
| + // PersistentHeapHashSet<Member<>> is used |
| + using ProxyClients = std::set<CompositorProxyClient*>; |
|
haraken
2016/04/19 23:35:52
Can you make CompositorMutator GarbageCollected? T
jbroman
2016/04/20 19:24:51
+1 An STL container holding raw pointers into the
jbroman
2016/04/20 21:06:42
Also, can the pointed-to type ever be anything oth
flackr
2016/04/25 14:06:28
Still working on getting this right. Somehow naive
|
| + ProxyClients m_proxyClients; |
| + |
| + OwnPtr<CustomCompositorAnimationManager> m_animationManager; |
| + OwnPtr<CompositorMutatorClient> m_client; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // CompositorMutatorImpl_h |