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

Unified Diff: cc/test/remote_proto_channel_bridge.h

Issue 1513643010: cc:: Add remote mode to the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use LayerTreeSettings::ToProtobuf, update comments. Created 5 years 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/test/remote_proto_channel_bridge.h
diff --git a/cc/test/remote_proto_channel_bridge.h b/cc/test/remote_proto_channel_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..57957f8790bc0db67cba5a87ae029912ccc41bd9
--- /dev/null
+++ b/cc/test/remote_proto_channel_bridge.h
@@ -0,0 +1,60 @@
+// 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 CC_TEST_REMOTE_PROTO_CHANNEL_BRIDGE_H_
+#define CC_TEST_REMOTE_PROTO_CHANNEL_BRIDGE_H_
+
+#include "base/macros.h"
+#include "cc/base/cc_export.h"
+#include "cc/test/test_hooks.h"
+#include "cc/trees/remote_proto_channel.h"
+
+namespace cc {
+class RemoteProtoChannelBridge;
+
+class CC_EXPORT FakeRemoteProtoChannel : public RemoteProtoChannel {
+ public:
+ explicit FakeRemoteProtoChannel(RemoteProtoChannelBridge* bridge);
+ ~FakeRemoteProtoChannel() override;
+
+ // RemoteProtoChannel implementation
+ void SetProtoReceiver(ProtoReceiver* receiver) override;
+
+ virtual void OnProtoReceived(scoped_ptr<proto::CompositorMessage> proto);
+
+ bool HasReceiver() const;
+
+ protected:
+ RemoteProtoChannelBridge* bridge_;
+
+ private:
+ RemoteProtoChannel::ProtoReceiver* receiver_;
+};
+
+class CC_EXPORT FakeRemoteProtoChannelMain : public FakeRemoteProtoChannel {
+ public:
+ explicit FakeRemoteProtoChannelMain(RemoteProtoChannelBridge* bridge);
+
+ void SendCompositorProto(const proto::CompositorMessage& proto) override;
+};
+
+class CC_EXPORT FakeRemoteProtoChannelImpl : public FakeRemoteProtoChannel {
+ public:
+ explicit FakeRemoteProtoChannelImpl(RemoteProtoChannelBridge* bridge);
+
+ void SendCompositorProto(const proto::CompositorMessage& proto) override;
+};
+
+class CC_EXPORT RemoteProtoChannelBridge {
+ public:
+ RemoteProtoChannelBridge();
+ ~RemoteProtoChannelBridge();
+
+ FakeRemoteProtoChannelMain channel_main;
+ FakeRemoteProtoChannelImpl channel_impl;
+};
+
+} // namespace cc
+
+#endif // CC_TEST_REMOTE_PROTO_CHANNEL_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698