Index: base/android/jni_generator/jni_generator.py |
diff --git a/base/android/jni_generator/jni_generator.py b/base/android/jni_generator/jni_generator.py |
index 4c58be2a94e8c51e77fa0d95fd68b4958fd028fe..6056b70c4217b28846daf02a46da5801dbaeadb3 100755 |
--- a/base/android/jni_generator/jni_generator.py |
+++ b/base/android/jni_generator/jni_generator.py |
@@ -740,7 +740,6 @@ $CONSTANT_FIELDS |
// Step 2: method stubs. |
$METHOD_STUBS |
-// Step 3: RegisterNatives. |
Torne
2016/08/01 11:51:41
I don't think you should remove this comment - it
|
$JNI_NATIVE_METHODS |
$REGISTER_NATIVES |
$CLOSE_NAMESPACE |
@@ -829,6 +828,10 @@ ${KMETHODS} |
def GetRegisterNativesString(self): |
"""Returns the code for RegisterNatives.""" |
+ natives = self.GetRegisterNativesImplString() |
+ if not natives: |
+ return '' |
+ |
template = Template("""\ |
${REGISTER_NATIVES_SIGNATURE} { |
${EARLY_EXIT} |
@@ -843,7 +846,6 @@ ${NATIVES} |
if (base::android::IsManualJniRegistrationDisabled()) return true; |
""" |
- natives = self.GetRegisterNativesImplString() |
values = {'REGISTER_NATIVES_SIGNATURE': signature, |
'EARLY_EXIT': early_exit, |
'NATIVES': natives, |
@@ -1101,7 +1103,6 @@ ${FUNCTION_SIGNATURE} {""") |
template = Template(""" |
static base::subtle::AtomicWord g_${JAVA_CLASS}_${METHOD_ID_VAR_NAME} = 0; |
${FUNCTION_HEADER} |
- /* Must call RegisterNativesImpl() */ |
Torne
2016/08/01 11:51:41
While it does make sense to remove this comment, c
|
CHECK_CLAZZ(env, ${FIRST_PARAM_IN_CALL}, |
${JAVA_CLASS}_clazz(env)${OPTIONAL_ERROR_RETURN}); |
jmethodID method_id = |