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

Unified Diff: ipc/ipc_channel_builder.cc

Issue 382333002: Introduce ChannelMojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing Mac build failure 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..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

Powered by Google App Engine
This is Rietveld 408576698