Chromium Code Reviews| Index: cc/blimp/remote_compositor_bridge.h |
| diff --git a/cc/blimp/remote_compositor_bridge.h b/cc/blimp/remote_compositor_bridge.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..147f408dd53b406705cc9abb6a191693c8c0e54e |
| --- /dev/null |
| +++ b/cc/blimp/remote_compositor_bridge.h |
| @@ -0,0 +1,55 @@ |
| +// 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 CC_BLIMP_REMOTE_COMPOSITOR_BRIDGE_H_ |
| +#define CC_BLIMP_REMOTE_COMPOSITOR_BRIDGE_H_ |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "cc/base/cc_export.h" |
| + |
| +namespace base { |
| +class SingleThreadTaskRunner; |
| +} // namespace base |
| + |
| +namespace cc { |
| +class CompositorProtoState; |
| +class RemoteCompositorBridgeClient; |
| + |
| +// The RemoteCompositorBridge is the compositor's communication bridge to the |
|
danakj
2016/09/30 22:37:13
It's not the compositor's communication bridge. It
Khushal
2016/10/01 00:53:48
Yup, the class structure is going to be that blimp
|
| +// compositor on the client that consumes the CompositorProtoState updates and |
| +// performs the actual compositing work. It is responsible for scheduling |
| +// when a state update should be sent to the client and providing back |
| +// mutations made to the state on the client. |
| +class CC_EXPORT RemoteCompositorBridge { |
| + public: |
| + RemoteCompositorBridge( |
| + scoped_refptr<base::SingleThreadTaskRunner> compositor_main_task_runner); |
| + |
| + virtual ~RemoteCompositorBridge(); |
| + |
| + // Must be called exactly once before the RemoteCompositorBridge can be |
| + // used. Once bound, the client is expected to outlive this class. |
| + virtual void BindToClient(RemoteCompositorBridgeClient* client) = 0; |
| + |
| + // Notifies the bridge that a main frame update is required. |
| + virtual void ScheduleMainFrame() = 0; |
| + |
| + // If a main frame update results in any mutations to the compositor state, |
| + // the serialized compositor state is provided to the |
| + // RemoteCompositorBridge. |
| + virtual void ProcessCompositorStateUpdate( |
| + std::unique_ptr<CompositorProtoState> compositor_proto_state) = 0; |
| + |
| + protected: |
| + // The task runner for the compositor's main thread. The |
| + // RemoteCompositorBridgeClient must be called on this task runner. |
| + scoped_refptr<base::SingleThreadTaskRunner> compositor_main_task_runner_; |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(RemoteCompositorBridge); |
| +}; |
| + |
| +} // namespace cc |
| +#endif // CC_BLIMP_REMOTE_COMPOSITOR_BRIDGE_H_ |