| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/watcher_impl.h" | 5 #include "mojo/android/system/watcher_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/android/base_jni_registrar.h" | 10 #include "base/android/base_jni_registrar.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 static jlong CreateWatcher(JNIEnv* env, const JavaParamRef<jobject>& jcaller) { | 79 static jlong CreateWatcher(JNIEnv* env, const JavaParamRef<jobject>& jcaller) { |
| 80 return reinterpret_cast<jlong>(new WatcherImpl); | 80 return reinterpret_cast<jlong>(new WatcherImpl); |
| 81 } | 81 } |
| 82 | 82 |
| 83 static jint Start(JNIEnv* env, | 83 static jint Start(JNIEnv* env, |
| 84 const JavaParamRef<jobject>& jcaller, | 84 const JavaParamRef<jobject>& jcaller, |
| 85 jlong watcher_ptr, | 85 jlong watcher_ptr, |
| 86 jint mojo_handle, | 86 jint mojo_handle, |
| 87 jint signals) { | 87 jint signals) { |
| 88 auto watcher = reinterpret_cast<WatcherImpl*>(watcher_ptr); | 88 auto* watcher = reinterpret_cast<WatcherImpl*>(watcher_ptr); |
| 89 return watcher->Start(env, jcaller, mojo_handle, signals); | 89 return watcher->Start(env, jcaller, mojo_handle, signals); |
| 90 } | 90 } |
| 91 | 91 |
| 92 static void Cancel(JNIEnv* env, | 92 static void Cancel(JNIEnv* env, |
| 93 const JavaParamRef<jobject>& jcaller, | 93 const JavaParamRef<jobject>& jcaller, |
| 94 jlong watcher_ptr) { | 94 jlong watcher_ptr) { |
| 95 reinterpret_cast<WatcherImpl*>(watcher_ptr)->Cancel(); | 95 reinterpret_cast<WatcherImpl*>(watcher_ptr)->Cancel(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 static void Delete(JNIEnv* env, | 98 static void Delete(JNIEnv* env, |
| 99 const JavaParamRef<jobject>& jcaller, | 99 const JavaParamRef<jobject>& jcaller, |
| 100 jlong watcher_ptr) { | 100 jlong watcher_ptr) { |
| 101 delete reinterpret_cast<WatcherImpl*>(watcher_ptr); | 101 delete reinterpret_cast<WatcherImpl*>(watcher_ptr); |
| 102 } | 102 } |
| 103 | 103 |
| 104 bool RegisterWatcherImpl(JNIEnv* env) { | 104 bool RegisterWatcherImpl(JNIEnv* env) { |
| 105 return RegisterNativesImpl(env); | 105 return RegisterNativesImpl(env); |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace android | 108 } // namespace android |
| 109 } // namespace mojo | 109 } // namespace mojo |
| OLD | NEW |