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