Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: remoting/protocol/message_pipe.h

Issue 1649063003: Add MessagePipe interface. Use it in ChannelDispatcherBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simple_parser
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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 REMOTING_PROTOCOL_MESSAGE_PIPE_H_
6 #define REMOTING_PROTOCOL_MESSAGE_PIPE_H_
7
8 #include "base/callback_forward.h"
9 #include "base/memory/scoped_ptr.h"
10
11 namespace google {
12 namespace protobuf {
13 class MessageLite;
14 } // namespace protobuf
15 } // namespace google
16
17 namespace remoting {
18
19 class CompoundBuffer;
20
21 namespace protocol {
22
23 // Represents a bi-directional pipe that allows to send and receive messages.
24 class MessagePipe {
25 public:
26 typedef base::Callback<void(scoped_ptr<CompoundBuffer> message)>
27 MessageReceivedCallback;
28
29 virtual ~MessagePipe() {}
30
31 // Starts receiving incoming messages and calls |callback| for each message.
32 virtual void StartReceiving(const MessageReceivedCallback& callback) = 0;
33
34 // Sends a message. |done| is called when the message has been sent to the
35 // client, but it doesn't mean that the client has received it. |done| is
36 // never called if the message is never sent (e.g. if the pipe is destroyed
37 // before the message is sent).
38 virtual void Send(google::protobuf::MessageLite* message,
39 const base::Closure& done) = 0;
40 };
41
42 } // namespace protocol
43 } // namespace remoting
44
45 #endif // REMOTING_PROTOCOL_MESSAGE_PIPE_H_
OLDNEW
« no previous file with comments | « remoting/protocol/host_video_dispatcher.cc ('k') | remoting/protocol/stream_message_pipe_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698