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

Side by Side 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: Addressing comments. Created 4 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CC_TEST_REMOTE_PROTO_CHANNEL_BRIDGE_H_
6 #define CC_TEST_REMOTE_PROTO_CHANNEL_BRIDGE_H_
7
8 #include "base/macros.h"
9 #include "cc/base/cc_export.h"
10 #include "cc/test/test_hooks.h"
11 #include "cc/trees/remote_proto_channel.h"
12
13 // The RemoteProtoChannelBridge mocks out the external network layer for the
14 // unit tests by sending messages directly between the RemoteProtoChannels for
15 // the server and client LayerTreeHost.
16 namespace cc {
17 class RemoteProtoChannelBridge;
18
19 class CC_EXPORT FakeRemoteProtoChannel : public RemoteProtoChannel {
20 public:
21 explicit FakeRemoteProtoChannel(RemoteProtoChannelBridge* bridge);
22 ~FakeRemoteProtoChannel() override;
23
24 // RemoteProtoChannel implementation
25 void SetProtoReceiver(ProtoReceiver* receiver) override;
26
27 virtual void OnProtoReceived(scoped_ptr<proto::CompositorMessage> proto);
28
29 bool HasReceiver() const;
30
31 protected:
32 RemoteProtoChannelBridge* bridge_;
33
34 private:
35 RemoteProtoChannel::ProtoReceiver* receiver_;
36 };
37
38 class CC_EXPORT FakeRemoteProtoChannelMain : public FakeRemoteProtoChannel {
39 public:
40 explicit FakeRemoteProtoChannelMain(RemoteProtoChannelBridge* bridge,
ericrk 2016/01/20 22:32:29 nit: remove explicit on a 2 arg constructor.
Khushal 2016/01/22 01:03:24 Done.
41 TestHooks* test_hooks);
42
43 void SendCompositorProto(const proto::CompositorMessage& proto) override;
44
45 private:
46 TestHooks* test_hooks_;
47 };
48
49 class CC_EXPORT FakeRemoteProtoChannelImpl : public FakeRemoteProtoChannel {
50 public:
51 explicit FakeRemoteProtoChannelImpl(RemoteProtoChannelBridge* bridge);
52
53 void SendCompositorProto(const proto::CompositorMessage& proto) override;
54 };
55
56 class CC_EXPORT RemoteProtoChannelBridge {
57 public:
58 explicit RemoteProtoChannelBridge(TestHooks* test_hooks);
59 ~RemoteProtoChannelBridge();
60
61 FakeRemoteProtoChannelMain channel_main;
62 FakeRemoteProtoChannelImpl channel_impl;
63 };
64
65 } // namespace cc
66
67 #endif // CC_TEST_REMOTE_PROTO_CHANNEL_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698