Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: ipc/ipc_channel_builder.cc

Issue 382333002: Introduce ChannelMojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698