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

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.
35 virtual void Send(google::protobuf::MessageLite* message,
36 const base::Closure& done) = 0;
37 };
38
39 } // namespace protocol
40 } // namespace remoting
41
42 #endif // REMOTING_PROTOCOL_MESSAGE_PIPE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698