| 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 "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 } else { | 227 } else { |
| 228 io_runner->PostTask( | 228 io_runner->PostTask( |
| 229 FROM_HERE, base::Bind(&mojo::embedder::DestroyChannelOnIOThread, ptr)); | 229 FROM_HERE, base::Bind(&mojo::embedder::DestroyChannelOnIOThread, ptr)); |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 | 232 |
| 233 //------------------------------------------------------------------------------ | 233 //------------------------------------------------------------------------------ |
| 234 | 234 |
| 235 // static | 235 // static |
| 236 bool ChannelMojo::ShouldBeUsed() { | 236 bool ChannelMojo::ShouldBeUsed() { |
| 237 return true; | 237 // TODO(rockot): Investigate performance bottlenecks and hopefully reenable |
| 238 // this at some point. http://crbug.com/500019 |
| 239 return false; |
| 238 } | 240 } |
| 239 | 241 |
| 240 // static | 242 // static |
| 241 scoped_ptr<ChannelMojo> ChannelMojo::Create( | 243 scoped_ptr<ChannelMojo> ChannelMojo::Create( |
| 242 scoped_refptr<base::TaskRunner> io_runner, | 244 scoped_refptr<base::TaskRunner> io_runner, |
| 243 const ChannelHandle& channel_handle, | 245 const ChannelHandle& channel_handle, |
| 244 Mode mode, | 246 Mode mode, |
| 245 Listener* listener, | 247 Listener* listener, |
| 246 AttachmentBroker* broker) { | 248 AttachmentBroker* broker) { |
| 247 switch (mode) { | 249 switch (mode) { |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 if (!ok) { | 551 if (!ok) { |
| 550 LOG(ERROR) << "Failed to add new Mojo handle."; | 552 LOG(ERROR) << "Failed to add new Mojo handle."; |
| 551 return MOJO_RESULT_UNKNOWN; | 553 return MOJO_RESULT_UNKNOWN; |
| 552 } | 554 } |
| 553 } | 555 } |
| 554 | 556 |
| 555 return MOJO_RESULT_OK; | 557 return MOJO_RESULT_OK; |
| 556 } | 558 } |
| 557 | 559 |
| 558 } // namespace IPC | 560 } // namespace IPC |
| OLD | NEW |