Chromium Code Reviews| Index: base/android/jni_generator/jni_generator_helper.h |
| diff --git a/base/android/jni_generator/jni_generator_helper.h b/base/android/jni_generator/jni_generator_helper.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..84087b9d12eb7cf33965f1c2949bae4519c5ff88 |
| --- /dev/null |
| +++ b/base/android/jni_generator/jni_generator_helper.h |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| + |
| +#ifndef BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_ |
| +#define BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_ |
| + |
| +#include <jni.h> |
| + |
| +#include "base/android/jni_android.h" |
| +#include "base/android/scoped_java_ref.h" |
| +#include "base/basictypes.h" |
| +#include "base/logging.h" |
| + |
| +// Project-specific macros used by the header files generated by |
| +// jni_generator.py. Different projects can then specify their own |
| +// implementation for this file. |
| +#define DCHECK_NATIVE_PTR(native_ptr, method_name, ...) \ |
|
rmcilroy
2013/12/13 14:14:51
Why the extra args here - does downstream use them
bulach
2013/12/13 15:23:58
that's right.. downstream has a slightly different
|
| + DCHECK(native_ptr) << method_name; |
| + |
| +#define DCHECK_CLAZZ(clazz, ...) \ |
| + DCHECK(clazz); |
| + |
| +namespace jni_generator { |
| + |
| + inline void HandleRegistrationError(JNIEnv* env, jclass clazz, |
| + const char* filename) { |
| + LOG(ERROR) << "RegisterNatives failed in " << filename; |
| + } |
| + |
| + inline void CheckException(JNIEnv* env) { |
| + base::android::CheckException(env); |
| + } |
| + |
| +} // namespace jni_generator |
| + |
| +using base::android::ScopedJavaLocalRef; |
| + |
| +#endif // BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_ |