OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ipc/mojo/ipc_channel_mojo.h" | 5 #include "ipc/mojo/ipc_channel_mojo.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "ipc/ipc_listener.h" | 10 #include "ipc/ipc_listener.h" |
11 #include "ipc/mojo/ipc_channel_mojo_readers.h" | 11 #include "ipc/mojo/ipc_channel_mojo_readers.h" |
12 #include "ipc/mojo/ipc_mojo_bootstrap.h" | 12 #include "ipc/mojo/ipc_mojo_bootstrap.h" |
13 #include "mojo/edk/embedder/embedder.h" | 13 #include "mojo/edk/embedder/embedder.h" |
14 | 14 |
15 #if defined(OS_POSIX) && !defined(OS_NACL) | 15 #if defined(OS_POSIX) && !defined(OS_NACL) |
16 #include "ipc/file_descriptor_set_posix.h" | 16 #include "ipc/file_descriptor_set_posix.h" |
17 #endif | 17 #endif |
18 | 18 |
19 namespace IPC { | 19 namespace IPC { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 class MojoChannelFactory : public ChannelFactory { | 23 class MojoChannelFactory : public ChannelFactory { |
24 public: | 24 public: |
25 MojoChannelFactory(ChannelMojo::Delegate* delegate, | 25 MojoChannelFactory(ChannelMojo::Delegate* delegate, |
26 ChannelHandle channel_handle, | 26 ChannelHandle channel_handle, |
27 Channel::Mode mode) | 27 Channel::Mode mode) |
28 : delegate_(delegate), channel_handle_(channel_handle), mode_(mode) {} | 28 : delegate_(delegate), channel_handle_(channel_handle), mode_(mode) {} |
29 | 29 |
30 virtual std::string GetName() const override { | 30 std::string GetName() const override { |
31 return channel_handle_.name; | 31 return channel_handle_.name; |
32 } | 32 } |
33 | 33 |
34 virtual scoped_ptr<Channel> BuildChannel(Listener* listener) override { | 34 scoped_ptr<Channel> BuildChannel(Listener* listener) override { |
35 return ChannelMojo::Create(delegate_, channel_handle_, mode_, listener); | 35 return ChannelMojo::Create(delegate_, channel_handle_, mode_, listener); |
36 } | 36 } |
37 | 37 |
38 private: | 38 private: |
39 ChannelMojo::Delegate* delegate_; | 39 ChannelMojo::Delegate* delegate_; |
40 ChannelHandle channel_handle_; | 40 ChannelHandle channel_handle_; |
41 Channel::Mode mode_; | 41 Channel::Mode mode_; |
42 }; | 42 }; |
43 | 43 |
44 } // namespace | 44 } // namespace |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 281 |
282 fdset->CommitAll(); | 282 fdset->CommitAll(); |
283 } | 283 } |
284 | 284 |
285 return MOJO_RESULT_OK; | 285 return MOJO_RESULT_OK; |
286 } | 286 } |
287 | 287 |
288 #endif // defined(OS_POSIX) && !defined(OS_NACL) | 288 #endif // defined(OS_POSIX) && !defined(OS_NACL) |
289 | 289 |
290 } // namespace IPC | 290 } // namespace IPC |
OLD | NEW |