OLD | NEW |
---|---|
(Empty) | |
1 // 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.
| |
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 }; | |
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.
| |
31 | |
32 } | |
viettrungluu
2014/07/15 16:28:06
nit: A "// namespace" comment would be nice
Hajime Morrita
2014/07/15 18:46:17
Done.
| |
33 | |
34 // static | |
35 scoped_ptr<ChannelBuilder> ChannelBuilder::CreatePlatformBuilder( | |
36 const ChannelHandle& handle, Channel::Mode mode) { | |
37 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.
| |
38 handle, mode)).PassAs<ChannelBuilder>(); | |
39 } | |
40 | |
41 } // namespace IPC | |
OLD | NEW |