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

Unified Diff: ipc/ipc_channel_factory.cc

Issue 382333002: Introduce ChannelMojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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_factory.cc
diff --git a/ipc/ipc_channel_factory.cc b/ipc/ipc_channel_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4cb1790382462f250ba0cca3ed9fd836553f08e0
--- /dev/null
+++ b/ipc/ipc_channel_factory.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_factory.h"
+
+namespace IPC {
+
+namespace {
+
+class PlatformChannelFactory : public ChannelFactory {
+ public:
+ PlatformChannelFactory(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(PlatformChannelFactory);
+};
+
+} // namespace
+
+// static
+scoped_ptr<ChannelFactory> ChannelFactory::Create(
+ const ChannelHandle& handle, Channel::Mode mode) {
+ return scoped_ptr<ChannelFactory>(new PlatformChannelFactory(handle, mode));
+}
+
+} // namespace IPC
« ipc/ipc_channel.h ('K') | « ipc/ipc_channel_factory.h ('k') | ipc/ipc_channel_nacl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698