| 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 // Being conservative, this is currently enabled only on Mac and | 178 // TODO(morrita): Turn this on for a set of platforms. |
| 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 | |
| 185 return false; | 179 return false; |
| 186 #endif | |
| 187 } | 180 } |
| 188 | 181 |
| 189 // static | 182 // static |
| 190 scoped_ptr<ChannelMojo> ChannelMojo::Create(ChannelMojo::Delegate* delegate, | 183 scoped_ptr<ChannelMojo> ChannelMojo::Create(ChannelMojo::Delegate* delegate, |
| 191 const ChannelHandle& channel_handle, | 184 const ChannelHandle& channel_handle, |
| 192 Mode mode, | 185 Mode mode, |
| 193 Listener* listener) { | 186 Listener* listener) { |
| 194 switch (mode) { | 187 switch (mode) { |
| 195 case Channel::MODE_CLIENT: | 188 case Channel::MODE_CLIENT: |
| 196 return make_scoped_ptr( | 189 return make_scoped_ptr( |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 393 |
| 401 fdset->CommitAll(); | 394 fdset->CommitAll(); |
| 402 } | 395 } |
| 403 | 396 |
| 404 return MOJO_RESULT_OK; | 397 return MOJO_RESULT_OK; |
| 405 } | 398 } |
| 406 | 399 |
| 407 #endif // defined(OS_POSIX) && !defined(OS_NACL) | 400 #endif // defined(OS_POSIX) && !defined(OS_NACL) |
| 408 | 401 |
| 409 } // namespace IPC | 402 } // namespace IPC |
| OLD | NEW |