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/android/system/core_impl.h" | 5 #include "mojo/android/system/core_impl.h" |
6 | 6 |
7 #include "base/android/base_jni_registrar.h" | 7 #include "base/android/base_jni_registrar.h" |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_registrar.h" | 9 #include "base/android/jni_registrar.h" |
10 #include "base/android/library_loader/library_loader_hooks.h" | 10 #include "base/android/library_loader/library_loader_hooks.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 const size_t nb_handles = buffer_size / record_size; | 71 const size_t nb_handles = buffer_size / record_size; |
72 const MojoHandle* handle_start = static_cast<const MojoHandle*>(buffer_start); | 72 const MojoHandle* handle_start = static_cast<const MojoHandle*>(buffer_start); |
73 const MojoWaitFlags* flags_start = | 73 const MojoWaitFlags* flags_start = |
74 static_cast<const MojoWaitFlags*>(handle_start + nb_handles); | 74 static_cast<const MojoWaitFlags*>(handle_start + nb_handles); |
75 return MojoWaitMany(handle_start, flags_start, nb_handles, deadline); | 75 return MojoWaitMany(handle_start, flags_start, nb_handles, deadline); |
76 } | 76 } |
77 | 77 |
78 static jobject CreateMessagePipe(JNIEnv* env, jobject jcaller) { | 78 static jobject CreateMessagePipe(JNIEnv* env, jobject jcaller) { |
79 MojoHandle handle1; | 79 MojoHandle handle1; |
80 MojoHandle handle2; | 80 MojoHandle handle2; |
81 MojoResult result = MojoCreateMessagePipe(&handle1, &handle2); | 81 // TODO(vtl): Add support for the options struct. |
| 82 MojoResult result = MojoCreateMessagePipe(NULL, &handle1, &handle2); |
82 return Java_CoreImpl_newNativeCreationResult(env, result, handle1, handle2) | 83 return Java_CoreImpl_newNativeCreationResult(env, result, handle1, handle2) |
83 .Release(); | 84 .Release(); |
84 } | 85 } |
85 | 86 |
86 static jobject CreateDataPipe(JNIEnv* env, | 87 static jobject CreateDataPipe(JNIEnv* env, |
87 jobject jcaller, | 88 jobject jcaller, |
88 jobject options_buffer) { | 89 jobject options_buffer) { |
89 const MojoCreateDataPipeOptions* options = NULL; | 90 const MojoCreateDataPipeOptions* options = NULL; |
90 if (options_buffer) { | 91 if (options_buffer) { |
91 const void* buffer_start = env->GetDirectBufferAddress(options_buffer); | 92 const void* buffer_start = env->GetDirectBufferAddress(options_buffer); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 MojoAsyncWaiter* async_waiter = mojo::GetDefaultAsyncWaiter(); | 365 MojoAsyncWaiter* async_waiter = mojo::GetDefaultAsyncWaiter(); |
365 async_waiter->CancelWait(async_waiter, id); | 366 async_waiter->CancelWait(async_waiter, id); |
366 } | 367 } |
367 | 368 |
368 bool RegisterCoreImpl(JNIEnv* env) { | 369 bool RegisterCoreImpl(JNIEnv* env) { |
369 return RegisterNativesImpl(env); | 370 return RegisterNativesImpl(env); |
370 } | 371 } |
371 | 372 |
372 } // namespace android | 373 } // namespace android |
373 } // namespace mojo | 374 } // namespace mojo |
OLD | NEW |