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 "mojo/edk/embedder/embedder.h" | 5 #include "mojo/edk/embedder/embedder.h" |
6 | 6 |
7 #include "base/atomicops.h" | 7 #include "base/atomicops.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // We'll have to set |channel_info->channel_id| on the I/O thread. | 138 // We'll have to set |channel_info->channel_id| on the I/O thread. |
139 scoped_ptr<ChannelInfo> channel_info(new ChannelInfo()); | 139 scoped_ptr<ChannelInfo> channel_info(new ChannelInfo()); |
140 | 140 |
141 if (rv.is_valid()) { | 141 if (rv.is_valid()) { |
142 io_thread_task_runner->PostTask( | 142 io_thread_task_runner->PostTask( |
143 FROM_HERE, | 143 FROM_HERE, |
144 base::Bind(&CreateChannelHelper, base::Passed(&platform_handle), | 144 base::Bind(&CreateChannelHelper, base::Passed(&platform_handle), |
145 base::Passed(&channel_info), channel_endpoint, callback, | 145 base::Passed(&channel_info), channel_endpoint, callback, |
146 callback_thread_task_runner)); | 146 callback_thread_task_runner)); |
147 } else { | 147 } else { |
148 (callback_thread_task_runner.get() ? callback_thread_task_runner | 148 (callback_thread_task_runner ? callback_thread_task_runner |
149 : io_thread_task_runner) | 149 : io_thread_task_runner) |
150 ->PostTask(FROM_HERE, base::Bind(callback, channel_info.release())); | 150 ->PostTask(FROM_HERE, base::Bind(callback, channel_info.release())); |
151 } | 151 } |
152 | 152 |
153 return rv.Pass(); | 153 return rv.Pass(); |
154 } | 154 } |
155 | 155 |
156 // TODO(vtl): Write tests for this. | 156 // TODO(vtl): Write tests for this. |
157 void DestroyChannel(ChannelInfo* channel_info) { | 157 void DestroyChannel(ChannelInfo* channel_info) { |
158 DCHECK(channel_info); | 158 DCHECK(channel_info); |
159 DCHECK(channel_info->channel_id); | 159 DCHECK(channel_info->channel_id); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 } | 211 } |
212 | 212 |
213 MojoResult AsyncWait(MojoHandle handle, | 213 MojoResult AsyncWait(MojoHandle handle, |
214 MojoHandleSignals signals, | 214 MojoHandleSignals signals, |
215 base::Callback<void(MojoResult)> callback) { | 215 base::Callback<void(MojoResult)> callback) { |
216 return internal::g_core->AsyncWait(handle, signals, callback); | 216 return internal::g_core->AsyncWait(handle, signals, callback); |
217 } | 217 } |
218 | 218 |
219 } // namespace embedder | 219 } // namespace embedder |
220 } // namespace mojo | 220 } // namespace mojo |
OLD | NEW |