blob: 7e1eafa38aa48514783a8a614d6db4f140097ba6 [file] [log] [blame]
zijiehef81a3b572017-06-11 23:03:371// 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
13namespace remoting {
14namespace protocol {
15
16FakeMessagePipeWrapper::FakeMessagePipeWrapper(FakeMessagePipe* pipe)
17 : pipe_(pipe) {
18 DCHECK(pipe_);
19}
20
21FakeMessagePipeWrapper::~FakeMessagePipeWrapper() = default;
22
23void FakeMessagePipeWrapper::Start(EventHandler* event_handler) {
24 pipe_->Start(event_handler);
25}
26
27void FakeMessagePipeWrapper::Send(google::protobuf::MessageLite* message,
28 const base::Closure& done) {
29 pipe_->Send(message, done);
30}
31
32void FakeMessagePipeWrapper::Receive(std::unique_ptr<CompoundBuffer> message) {
33 pipe_->Receive(std::move(message));
34}
35
36void FakeMessagePipeWrapper::OpenPipe() {
37 pipe_->OpenPipe();
38}
39
40void FakeMessagePipeWrapper::ClosePipe() {
41 pipe_->ClosePipe();
42}
43
44} // namespace protocol
45} // namespace remoting