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

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

Issue 2907073003: [Chromoting] Add DataChannelManager to manage optional incoming data channels (Closed)
Patch Set: Created 3 years, 6 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 2017 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_FAKE_MESSAGE_PIPE_H_
6 #define REMOTING_PROTOCOL_FAKE_MESSAGE_PIPE_H_
7
8 #include <memory>
9
10 #include "remoting/protocol/message_pipe.h"
11
12 namespace google {
13 namespace protobuf {
14 class MessageLite;
15 } // namespace protobuf
16 } // namespace google
17
18 namespace remoting {
19 namespace protocol {
20
21 class FakeMessagePipeWrapper;
22
23 class FakeMessagePipe final : public MessagePipe {
24 public:
25 // Sets |asynchronous| to true to make all operations asynchronizedly.
joedow 2017/05/30 16:24:18 I don't think this comment is needed. The param n
Hzj_jie 2017/05/31 00:11:53 Done.
26 explicit FakeMessagePipe(bool asynchronous);
27 ~FakeMessagePipe() override;
28
29 // Creates an std::unique_ptr<FakeMessagePipeWrapper> instance to wrap |this|.
30 // All operations will be forwarded to |this|.
31 std::unique_ptr<FakeMessagePipeWrapper> Wrap();
joedow 2017/05/30 16:24:18 Why is this needed? Someone who has access to thi
Hzj_jie 2017/05/31 00:11:53 It returns an FakeMessagePipeWrapper which forward
32
33 // MessagePipe implementation.
34 void Start(EventHandler* event_handler) override;
35 void Send(google::protobuf::MessageLite* message,
36 const base::Closure& done) override;
37
38 // Triggers EventHandler::OnMessageReceived().
joedow 2017/05/30 16:24:18 I would remove the impl detail comments since they
Hzj_jie 2017/05/31 00:11:53 Done.
39 void Receive(std::unique_ptr<CompoundBuffer> message);
40
41 // Triggers EventHandler::OnMessagePipeOpen().
42 void OpenPipe();
43
44 // Triggers EventHandler::OnMessagePipeClosed();
45 void ClosePipe();
46
47 private:
48 const bool asynchronous_;
49 bool pipe_opened_ = false;
50 EventHandler* event_handler_ = nullptr;
51 };
52
53 } // namespace protocol
54 } // namespace remoting
55
56 #endif // REMOTING_PROTOCOL_FAKE_MESSAGE_PIPE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698