Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2935)

Unified Diff: cc/blimp/remote_compositor_bridge.h

Issue 2362073002: cc/blimp: Add a LayerTreeHostRemote implementation. (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..d4a0eded8e90ed0a3beae1f836b4ae6e74599e7a
--- /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 remote LTH's communication bridge to the
+// 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_

Powered by Google App Engine
This is Rietveld 408576698