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 virtual 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 virtual 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 .PassAs<Channel>(); | 36 .PassAs<Channel>(); |
37 } | 37 } |
38 | 38 |
39 private: | 39 private: |
40 ChannelMojo::Delegate* delegate_; | 40 ChannelMojo::Delegate* delegate_; |
41 ChannelHandle channel_handle_; | 41 ChannelHandle channel_handle_; |
42 Channel::Mode mode_; | 42 Channel::Mode mode_; |
43 }; | 43 }; |
44 | 44 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 fdset->CommitAll(); | 279 fdset->CommitAll(); |
280 } | 280 } |
281 | 281 |
282 return MOJO_RESULT_OK; | 282 return MOJO_RESULT_OK; |
283 } | 283 } |
284 | 284 |
285 #endif // defined(OS_POSIX) && !defined(OS_NACL) | 285 #endif // defined(OS_POSIX) && !defined(OS_NACL) |
286 | 286 |
287 } // namespace IPC | 287 } // namespace IPC |
OLD | NEW |