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" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 void ChannelMojo::ChannelInfoDeleter::operator()( | 169 void ChannelMojo::ChannelInfoDeleter::operator()( |
170 mojo::embedder::ChannelInfo* ptr) const { | 170 mojo::embedder::ChannelInfo* ptr) const { |
171 mojo::embedder::DestroyChannelOnIOThread(ptr); | 171 mojo::embedder::DestroyChannelOnIOThread(ptr); |
172 } | 172 } |
173 | 173 |
174 //------------------------------------------------------------------------------ | 174 //------------------------------------------------------------------------------ |
175 | 175 |
176 // static | 176 // static |
177 bool ChannelMojo::ShouldBeUsed() { | 177 bool ChannelMojo::ShouldBeUsed() { |
178 // TODO(morrita): Turn this on for a set of platforms. | 178 // Being conservative, this is currently enabled only on Mac and |
| 179 // Linux even though this should work on all platforms. |
| 180 // TODO(morrita): Turn this on all platform and kill |
| 181 // --enable-renderer-mojo-channel |
| 182 #if defined(OS_POSIX) && !defined(OS_ANDROID) |
| 183 return true; |
| 184 #else |
179 return false; | 185 return false; |
| 186 #endif |
180 } | 187 } |
181 | 188 |
182 // static | 189 // static |
183 scoped_ptr<ChannelMojo> ChannelMojo::Create(ChannelMojo::Delegate* delegate, | 190 scoped_ptr<ChannelMojo> ChannelMojo::Create(ChannelMojo::Delegate* delegate, |
184 const ChannelHandle& channel_handle, | 191 const ChannelHandle& channel_handle, |
185 Mode mode, | 192 Mode mode, |
186 Listener* listener) { | 193 Listener* listener) { |
187 switch (mode) { | 194 switch (mode) { |
188 case Channel::MODE_CLIENT: | 195 case Channel::MODE_CLIENT: |
189 return make_scoped_ptr( | 196 return make_scoped_ptr( |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 | 400 |
394 fdset->CommitAll(); | 401 fdset->CommitAll(); |
395 } | 402 } |
396 | 403 |
397 return MOJO_RESULT_OK; | 404 return MOJO_RESULT_OK; |
398 } | 405 } |
399 | 406 |
400 #endif // defined(OS_POSIX) && !defined(OS_NACL) | 407 #endif // defined(OS_POSIX) && !defined(OS_NACL) |
401 | 408 |
402 } // namespace IPC | 409 } // namespace IPC |
OLD | NEW |