Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_WRAPPER_H_ | |
| 6 #define REMOTING_PROTOCOL_FAKE_MESSAGE_PIPE_WRAPPER_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 FakeMessagePipe; | |
| 22 | |
| 23 class FakeMessagePipeWrapper final : public MessagePipe { | |
|
Sergey Ulanov
2017/06/05 18:48:29
Add a comment here to make it clear how this class
Hzj_jie
2017/06/06 03:21:52
Done.
| |
| 24 public: | |
| 25 // |pipe| must outlive this instance. | |
| 26 explicit FakeMessagePipeWrapper(FakeMessagePipe* pipe); | |
| 27 ~FakeMessagePipeWrapper() override; | |
| 28 | |
| 29 // MessagePipe implementation. | |
| 30 void Start(EventHandler* event_handler) override; | |
| 31 void Send(google::protobuf::MessageLite* message, | |
| 32 const base::Closure& done) override; | |
| 33 | |
| 34 void Receive(std::unique_ptr<CompoundBuffer> message); | |
| 35 void OpenPipe(); | |
| 36 void ClosePipe(); | |
| 37 | |
| 38 private: | |
| 39 FakeMessagePipe* const pipe_; | |
| 40 }; | |
| 41 | |
| 42 } // namespace protocol | |
| 43 } // namespace remoting | |
| 44 | |
| 45 #endif // REMOTING_PROTOCOL_FAKE_MESSAGE_PIPE_WRAPPER_H_ | |
| OLD | NEW |