| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CompositorProxyClient_h | 5 #ifndef CompositorProxyClient_h |
| 6 #define CompositorProxyClient_h | 6 #define CompositorProxyClient_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/workers/WorkerClients.h" | 9 #include "core/workers/WorkerClients.h" |
| 10 #include "wtf/Noncopyable.h" | 10 #include "wtf/Noncopyable.h" |
| 11 | 11 |
| 12 #include <v8.h> | 12 #include <v8.h> |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class CompositorProxy; | 16 class CompositorProxy; |
| 17 class Event; | |
| 18 class ScriptState; | |
| 19 class WorkerClients; | 17 class WorkerClients; |
| 20 class WorkerGlobalScope; | 18 class WorkerGlobalScope; |
| 21 | 19 |
| 22 class CORE_EXPORT CompositorProxyClient : public Supplement<WorkerClients> { | 20 class CORE_EXPORT CompositorProxyClient : public Supplement<WorkerClients> { |
| 23 WTF_MAKE_NONCOPYABLE(CompositorProxyClient); | 21 WTF_MAKE_NONCOPYABLE(CompositorProxyClient); |
| 24 | 22 |
| 25 public: | 23 public: |
| 26 CompositorProxyClient() {} | 24 CompositorProxyClient() {} |
| 27 | 25 |
| 28 static CompositorProxyClient* from(WorkerClients*); | 26 static CompositorProxyClient* from(WorkerClients*); |
| 29 static const char* supplementName(); | 27 static const char* supplementName(); |
| 30 | 28 |
| 31 virtual void dispose() = 0; | 29 virtual void dispose() = 0; |
| 32 virtual void setGlobalScope(WorkerGlobalScope*) = 0; | 30 virtual void setGlobalScope(WorkerGlobalScope*) = 0; |
| 33 virtual void requestAnimationFrame() = 0; | 31 virtual void requestAnimationFrame() = 0; |
| 34 virtual void registerCompositorProxy(CompositorProxy*) = 0; | 32 virtual void registerCompositorProxy(CompositorProxy*) = 0; |
| 35 // It is not guaranteed to receive an unregister call for every registered | 33 // It is not guaranteed to receive an unregister call for every registered |
| 36 // proxy. In fact we only receive one when a proxy is explicitly | 34 // proxy. In fact we only receive one when a proxy is explicitly |
| 37 // disconnected otherwise we rely on oilpan collection process to remove the | 35 // disconnected otherwise we rely on oilpan collection process to remove the |
| 38 // weak reference to the proxy. | 36 // weak reference to the proxy. |
| 39 virtual void unregisterCompositorProxy(CompositorProxy*) = 0; | 37 virtual void unregisterCompositorProxy(CompositorProxy*) = 0; |
| 40 }; | 38 }; |
| 41 | 39 |
| 42 CORE_EXPORT void provideCompositorProxyClientTo(WorkerClients*, | 40 CORE_EXPORT void provideCompositorProxyClientTo(WorkerClients*, |
| 43 CompositorProxyClient*); | 41 CompositorProxyClient*); |
| 44 | 42 |
| 45 } // namespace blink | 43 } // namespace blink |
| 46 | 44 |
| 47 #endif // CompositorProxyClient_h | 45 #endif // CompositorProxyClient_h |
| OLD | NEW |