Chromium Code Reviews| Index: remoting/protocol/fake_message_pipe_wrapper.h |
| diff --git a/remoting/protocol/fake_message_pipe_wrapper.h b/remoting/protocol/fake_message_pipe_wrapper.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5124172ab9eca056167915a0a4b3d80ed85edeb6 |
| --- /dev/null |
| +++ b/remoting/protocol/fake_message_pipe_wrapper.h |
| @@ -0,0 +1,45 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef REMOTING_PROTOCOL_FAKE_MESSAGE_PIPE_WRAPPER_H_ |
| +#define REMOTING_PROTOCOL_FAKE_MESSAGE_PIPE_WRAPPER_H_ |
| + |
| +#include <memory> |
| + |
| +#include "remoting/protocol/message_pipe.h" |
| + |
| +namespace google { |
| +namespace protobuf { |
| +class MessageLite; |
| +} // namespace protobuf |
| +} // namespace google |
| + |
| +namespace remoting { |
| +namespace protocol { |
| + |
| +class FakeMessagePipe; |
| + |
| +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.
|
| + public: |
| + // |pipe| must outlive this instance. |
| + explicit FakeMessagePipeWrapper(FakeMessagePipe* pipe); |
| + ~FakeMessagePipeWrapper() override; |
| + |
| + // MessagePipe implementation. |
| + void Start(EventHandler* event_handler) override; |
| + void Send(google::protobuf::MessageLite* message, |
| + const base::Closure& done) override; |
| + |
| + void Receive(std::unique_ptr<CompoundBuffer> message); |
| + void OpenPipe(); |
| + void ClosePipe(); |
| + |
| + private: |
| + FakeMessagePipe* const pipe_; |
| +}; |
| + |
| +} // namespace protocol |
| +} // namespace remoting |
| + |
| +#endif // REMOTING_PROTOCOL_FAKE_MESSAGE_PIPE_WRAPPER_H_ |