zijiehe | f81a3b57 | 2017-06-11 23:03:37 | [diff] [blame] | 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 | #include "remoting/protocol/fake_message_pipe_wrapper.h" |
| 6 | |
| 7 | #include <utility> |
| 8 | |
| 9 | #include "base/logging.h" |
| 10 | #include "remoting/base/compound_buffer.h" |
| 11 | #include "remoting/protocol/fake_message_pipe.h" |
| 12 | |
| 13 | namespace remoting { |
| 14 | namespace protocol { |
| 15 | |
| 16 | FakeMessagePipeWrapper::FakeMessagePipeWrapper(FakeMessagePipe* pipe) |
| 17 | : pipe_(pipe) { |
| 18 | DCHECK(pipe_); |
| 19 | } |
| 20 | |
| 21 | FakeMessagePipeWrapper::~FakeMessagePipeWrapper() = default; |
| 22 | |
| 23 | void FakeMessagePipeWrapper::Start(EventHandler* event_handler) { |
| 24 | pipe_->Start(event_handler); |
| 25 | } |
| 26 | |
| 27 | void FakeMessagePipeWrapper::Send(google::protobuf::MessageLite* message, |
| 28 | const base::Closure& done) { |
| 29 | pipe_->Send(message, done); |
| 30 | } |
| 31 | |
| 32 | void FakeMessagePipeWrapper::Receive(std::unique_ptr<CompoundBuffer> message) { |
| 33 | pipe_->Receive(std::move(message)); |
| 34 | } |
| 35 | |
| 36 | void FakeMessagePipeWrapper::OpenPipe() { |
| 37 | pipe_->OpenPipe(); |
| 38 | } |
| 39 | |
| 40 | void FakeMessagePipeWrapper::ClosePipe() { |
| 41 | pipe_->ClosePipe(); |
| 42 | } |
| 43 | |
| 44 | } // namespace protocol |
| 45 | } // namespace remoting |