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..65823e219eeaa69c59f6c3c39327f5c5e77d4ab7 |
--- /dev/null |
+++ b/ipc/ipc_channel_builder.cc |
@@ -0,0 +1,41 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
viettrungluu
2014/07/15 16:28:07
2014, etc. (and everywhere else)
Hajime Morrita
2014/07/15 18:46:17
Done.
|
+// 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_; |
+}; |
viettrungluu
2014/07/15 16:28:06
Probably you should have a DISALLOW_COPY_AND_ASSIG
Hajime Morrita
2014/07/15 18:46:17
Done.
|
+ |
+} |
viettrungluu
2014/07/15 16:28:06
nit: A "// namespace" comment would be nice
Hajime Morrita
2014/07/15 18:46:17
Done.
|
+ |
+// static |
+scoped_ptr<ChannelBuilder> ChannelBuilder::CreatePlatformBuilder( |
+ const ChannelHandle& handle, Channel::Mode mode) { |
+ return make_scoped_ptr(new PlatformChannelBuilder( |
viettrungluu
2014/07/15 16:28:07
nit: I think you can just do scoped_ptr<ChannelBui
Hajime Morrita
2014/07/15 18:46:17
Right. Done.
|
+ handle, mode)).PassAs<ChannelBuilder>(); |
+} |
+ |
+} // namespace IPC |