| 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" |
| 11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "jni/CoreImpl_jni.h" | 15 #include "jni/CoreImpl_jni.h" |
| 16 #include "mojo/public/c/environment/async_waiter.h" | 16 #include "third_party/mojo/src/mojo/public/c/environment/async_waiter.h" |
| 17 #include "mojo/public/c/system/core.h" | 17 #include "third_party/mojo/src/mojo/public/c/system/core.h" |
| 18 #include "mojo/public/cpp/environment/environment.h" | 18 #include "third_party/mojo/src/mojo/public/cpp/environment/environment.h" |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // |AsyncWait| is guaranteed never to return 0. | 22 // |AsyncWait| is guaranteed never to return 0. |
| 23 const MojoAsyncWaitID kInvalidHandleCancelID = 0; | 23 const MojoAsyncWaitID kInvalidHandleCancelID = 0; |
| 24 | 24 |
| 25 struct AsyncWaitCallbackData { | 25 struct AsyncWaitCallbackData { |
| 26 base::android::ScopedJavaGlobalRef<jobject> core_impl; | 26 base::android::ScopedJavaGlobalRef<jobject> core_impl; |
| 27 base::android::ScopedJavaGlobalRef<jobject> callback; | 27 base::android::ScopedJavaGlobalRef<jobject> callback; |
| 28 base::android::ScopedJavaGlobalRef<jobject> cancellable; | 28 base::android::ScopedJavaGlobalRef<jobject> cancellable; |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 reinterpret_cast<AsyncWaitCallbackData*>(data_ptr)); | 394 reinterpret_cast<AsyncWaitCallbackData*>(data_ptr)); |
| 395 Environment::GetDefaultAsyncWaiter()->CancelWait(id); | 395 Environment::GetDefaultAsyncWaiter()->CancelWait(id); |
| 396 } | 396 } |
| 397 | 397 |
| 398 bool RegisterCoreImpl(JNIEnv* env) { | 398 bool RegisterCoreImpl(JNIEnv* env) { |
| 399 return RegisterNativesImpl(env); | 399 return RegisterNativesImpl(env); |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace android | 402 } // namespace android |
| 403 } // namespace mojo | 403 } // namespace mojo |
| OLD | NEW |