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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ipc/ipc_channel_builder.h"
6
7 namespace IPC {
8
9 namespace {
10
11 class PlatformChannelBuilder : public ChannelBuilder {
12 public:
13 PlatformChannelBuilder(ChannelHandle handle,
14 Channel::Mode mode)
15 : handle_(handle), mode_(mode) {
16 }
17
18 virtual std::string GetName() const OVERRIDE {
19 return handle_.name;
20 }
21
22 virtual scoped_ptr<Channel> BuildChannel(
23 Listener* listener) OVERRIDE {
24 return Channel::Create(handle_, mode_, listener);
25 }
26
27 private:
28 ChannelHandle handle_;
29 Channel::Mode mode_;
30
31 DISALLOW_COPY_AND_ASSIGN(PlatformChannelBuilder);
32 };
33
34 } // namespace
35
36 // static
37 scoped_ptr<ChannelBuilder> ChannelBuilder::CreatePlatformBuilder(
38 const ChannelHandle& handle, Channel::Mode mode) {
39 return scoped_ptr<ChannelBuilder>(new PlatformChannelBuilder(handle, mode));
40 }
41
42 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698