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

Unified Diff: blimp/engine/renderer/blimp_remote_compositor_bridge.h

Issue 2413063002: content/blimp: Set up hooks for enabling LTHRemote in the renderer. (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: blimp/engine/renderer/blimp_remote_compositor_bridge.h
diff --git a/blimp/engine/renderer/blimp_remote_compositor_bridge.h b/blimp/engine/renderer/blimp_remote_compositor_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..cd9b087d8083931c40f5b24a101fcdffdb0870a1
--- /dev/null
+++ b/blimp/engine/renderer/blimp_remote_compositor_bridge.h
@@ -0,0 +1,54 @@
+// 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 BLIMP_ENGINE_RENDERER_BLIMP_REMOTE_COMPOSITOR_BRIDGE_H_
+#define BLIMP_ENGINE_RENDERER_BLIMP_REMOTE_COMPOSITOR_BRIDGE_H_
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "blimp/engine/renderer/scheduler.h"
+#include "cc/blimp/remote_compositor_bridge.h"
+#include "cc/trees/remote_proto_channel.h"
+
+namespace blimp {
+namespace engine {
+
+class BlimpRemoteCompositorBridge
+ : public cc::RemoteCompositorBridge,
+ public cc::RemoteProtoChannel::ProtoReceiver,
+ public SchedulerClient {
+ public:
+ // TODO(khushalsagar): Stop using the RemoteProtoChannel. See
+ // crbug.com/653697.
+ BlimpRemoteCompositorBridge(
+ cc::RemoteProtoChannel* remote_proto_channel,
Wez 2016/10/19 22:15:27 nit: Clarify ownership/lifetime of this?
Khushal 2016/10/20 01:29:33 Done.
+ scoped_refptr<base::SingleThreadTaskRunner> compositor_main_task_runner);
+ ~BlimpRemoteCompositorBridge() override;
+
+ // cc::RemoteCompositorBridge implementation.
+ void BindToClient(cc::RemoteCompositorBridgeClient* client) override;
+ void ScheduleMainFrame() override;
+ void ProcessCompositorStateUpdate(std::unique_ptr<cc::CompositorProtoState>
+ compositor_proto_state) override;
+
+ private:
+ // cc::RemoteProtoChannel::ProtoReceiver implementation.
+ void OnProtoReceived(
+ std::unique_ptr<cc::proto::CompositorMessage> proto) override;
+
+ // SchedulerClient implementation.
+ void StartFrameUpdate() override;
+
+ cc::RemoteProtoChannel* remote_proto_channel_;
+ cc::RemoteCompositorBridgeClient* client_ = nullptr;
+
+ Scheduler scheduler_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlimpRemoteCompositorBridge);
+};
+
+} // namespace engine
+} // namespace blimp
+
+#endif // BLIMP_ENGINE_RENDERER_BLIMP_REMOTE_COMPOSITOR_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698