| 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..d8f4edb378ffdd20b6b5bfaf8a96086b542bf520
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/web/CompositorProxyClientImpl.h
|
| @@ -0,0 +1,75 @@
|
| +// 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 "public/platform/WebMutation.h"
|
| +#include "wtf/Noncopyable.h"
|
| +
|
| +#include <map>
|
| +#include <set>
|
| +#include <vector>
|
| +
|
| +namespace blink {
|
| +
|
| +class CompositorProxy;
|
| +class CompositorWorkerGlobalScope;
|
| +class WebCompositorMutableStateProvider;
|
| +class WebMutatorImpl;
|
| +class WorkerGlobalScope;
|
| +
|
| +class CompositorProxyClientImpl : public CompositorProxyClient {
|
| + WTF_MAKE_NONCOPYABLE(CompositorProxyClientImpl);
|
| +
|
| +public:
|
| + explicit CompositorProxyClientImpl(WebMutatorImpl*);
|
| + ~CompositorProxyClientImpl() override;
|
| +
|
| + bool mutate(double timeNow, WebCompositorMutableStateProvider*);
|
| +
|
| + // CompositorProxyClient:
|
| + void registerCompositorProxy(CompositorProxy*) override;
|
| + void unregisterCompositorProxy(CompositorProxy*) override;
|
| + void requestSync(CompositorProxy*) override;
|
| +
|
| + void setGlobalScope(WorkerGlobalScope*) override;
|
| + void requestMutation() override;
|
| +
|
| +private:
|
| + void willStartCompositorFrameCallbacks(WebCompositorMutableStateProvider*);
|
| + bool executeAnimationFrameCallbacks(double time);
|
| +
|
| + WebMutatorImpl* m_mutator;
|
| +
|
| + // TODO(vollick): These could use wtf containers, but this would force
|
| + // us to oilpan-ify WebMutatorImpl and, transitively, a lot more stuff.
|
| + // Particularly problematic in that stuff is the rAF task which must be
|
| + // created outside of a safe point and whose ownership is passed between
|
| + // threads. The code as it stands is correct and the raw pointers here
|
| + // have the right semantics. Namely, they should not be traced (i.e.,
|
| + // they do not hide memory that should be visible to oilpan), they do
|
| + // not retain the CompositorProxies (their lifetime is managed by
|
| + // oilpan), they will continue to be valid during the lifetime of the
|
| + // CompositorProxies (since oilpan is not a compacting GC), and we do
|
| + // not want oilpan to take action to clear out these collections or
|
| + // update weak pointers when the objects are destroyed (we handle that
|
| + // ourselves via disconnection). In short, we do not need oilpan to do
|
| + // management for us because we're handling it ourself and we need to
|
| + // handle it ourself because of our unique multi-threaded requirements.
|
| + typedef std::vector<CompositorProxy*> ProxyVector;
|
| + typedef std::map<uint64_t, ProxyVector> ProxyMap;
|
| + ProxyMap m_proxies;
|
| + HashSet<uint64_t> m_requiresSync;
|
| +
|
| + CompositorWorkerGlobalScope* m_globalScope;
|
| + bool m_executingAnimationFrameCallbacks;
|
| + bool m_requestedAnimationFrameCallbacks;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // CompositorProxyClientImpl_h
|
|
|