| Index: ipc/ipc_channel_builder.cc
|
| diff --git a/ipc/ipc_channel_builder.cc b/ipc/ipc_channel_builder.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c07f7e7342c85c8223bb8fb88ebe800a80fea3cf
|
| --- /dev/null
|
| +++ b/ipc/ipc_channel_builder.cc
|
| @@ -0,0 +1,42 @@
|
| +// Copyright 2014 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.
|
| +
|
| +#include "ipc/ipc_channel_builder.h"
|
| +
|
| +namespace IPC {
|
| +
|
| +namespace {
|
| +
|
| +class PlatformChannelBuilder : public ChannelBuilder {
|
| + public:
|
| + PlatformChannelBuilder(ChannelHandle handle,
|
| + Channel::Mode mode)
|
| + : handle_(handle), mode_(mode) {
|
| + }
|
| +
|
| + virtual std::string GetName() const OVERRIDE {
|
| + return handle_.name;
|
| + }
|
| +
|
| + virtual scoped_ptr<Channel> BuildChannel(
|
| + Listener* listener) OVERRIDE {
|
| + return Channel::Create(handle_, mode_, listener);
|
| + }
|
| +
|
| + private:
|
| + ChannelHandle handle_;
|
| + Channel::Mode mode_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(PlatformChannelBuilder);
|
| +};
|
| +
|
| +} // namespace
|
| +
|
| +// static
|
| +scoped_ptr<ChannelBuilder> ChannelBuilder::CreatePlatformBuilder(
|
| + const ChannelHandle& handle, Channel::Mode mode) {
|
| + return scoped_ptr<ChannelBuilder>(new PlatformChannelBuilder(handle, mode));
|
| +}
|
| +
|
| +} // namespace IPC
|
|
|