Chromium Code Reviews| Index: remoting/protocol/message_pipe.h |
| diff --git a/remoting/protocol/message_pipe.h b/remoting/protocol/message_pipe.h |
| index 6d8eeebbfe051c2d508e5976059a4a7f5d7ec316..bab42667a4dbdee9b451a8ffada82a346e047507 100644 |
| --- a/remoting/protocol/message_pipe.h |
| +++ b/remoting/protocol/message_pipe.h |
| @@ -24,13 +24,23 @@ namespace protocol { |
| // Represents a bi-directional pipe that allows to send and receive messages. |
| class MessagePipe { |
| public: |
| - typedef base::Callback<void(std::unique_ptr<CompoundBuffer> message)> |
| - MessageReceivedCallback; |
| + class EventHandler { |
| + public: |
| + // Called when a message is received. |
| + virtual void OnMessageReceived(std::unique_ptr<CompoundBuffer> message) = 0; |
| + |
| + // Called when the channel is closed. |
| + virtual void OnMessagePipeClosed() = 0; |
| + |
| + protected: |
| + virtual ~EventHandler() {} |
| + }; |
| virtual ~MessagePipe() {} |
| - // Starts receiving incoming messages and calls |callback| for each message. |
| - virtual void StartReceiving(const MessageReceivedCallback& callback) = 0; |
| + // Starts the channel. |event_handle| will be called to notify when a message |
|
Jamie
2016/07/19 18:24:47
s/handle/handler/
Sergey Ulanov
2016/07/19 23:38:43
Done.
|
| + // is received of the pipe is closed. |
|
Jamie
2016/07/19 18:24:47
s/of/or/
Sergey Ulanov
2016/07/19 23:38:43
Done.
|
| + virtual void Start(EventHandler* event_handler) = 0; |
| // Sends a message. |done| is called when the message has been sent to the |
| // client, but it doesn't mean that the client has received it. |done| is |