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