OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_TREES_REMOTE_PROTO_CHANNEL_H_ | 5 #ifndef CC_TREES_REMOTE_PROTO_CHANNEL_H_ |
6 #define CC_TREES_REMOTE_PROTO_CHANNEL_H_ | 6 #define CC_TREES_REMOTE_PROTO_CHANNEL_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "cc/base/cc_export.h" |
9 | 10 |
10 namespace cc { | 11 namespace cc { |
11 | 12 |
12 namespace proto { | 13 namespace proto { |
13 class CompositorMessage; | 14 class CompositorMessage; |
14 } | 15 } |
15 | 16 |
16 // Provides a bridge for getting compositor protobuf messages to/from the | 17 // Provides a bridge for getting compositor protobuf messages to/from the |
17 // outside world. | 18 // outside world. |
18 class RemoteProtoChannel { | 19 class CC_EXPORT RemoteProtoChannel { |
19 public: | 20 public: |
20 // Meant to be implemented by a RemoteChannel that needs to receive and parse | 21 // Meant to be implemented by a RemoteChannel that needs to receive and parse |
21 // incoming protobufs. | 22 // incoming protobufs. |
22 class ProtoReceiver { | 23 class CC_EXPORT ProtoReceiver { |
23 public: | 24 public: |
| 25 // TODO(khushalsagar): This should probably include a closure that returns |
| 26 // the status of processing this proto. See crbug/576974 |
24 virtual void OnProtoReceived( | 27 virtual void OnProtoReceived( |
25 scoped_ptr<proto::CompositorMessage> proto) = 0; | 28 scoped_ptr<proto::CompositorMessage> proto) = 0; |
26 | 29 |
27 protected: | 30 protected: |
28 virtual ~ProtoReceiver() {} | 31 virtual ~ProtoReceiver() {} |
29 }; | 32 }; |
30 | 33 |
| 34 // Called by the ProtoReceiver. The RemoteProtoChannel must outlive its |
| 35 // receiver. |
31 virtual void SetProtoReceiver(ProtoReceiver* receiver) = 0; | 36 virtual void SetProtoReceiver(ProtoReceiver* receiver) = 0; |
| 37 |
32 virtual void SendCompositorProto(const proto::CompositorMessage& proto) = 0; | 38 virtual void SendCompositorProto(const proto::CompositorMessage& proto) = 0; |
33 | 39 |
34 protected: | 40 protected: |
35 virtual ~RemoteProtoChannel() {} | 41 virtual ~RemoteProtoChannel() {} |
36 }; | 42 }; |
37 | 43 |
38 } // namespace cc | 44 } // namespace cc |
39 | 45 |
40 #endif // CC_TREES_REMOTE_PROTO_CHANNEL_H_ | 46 #endif // CC_TREES_REMOTE_PROTO_CHANNEL_H_ |
OLD | NEW |