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