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