Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1698)

Unified Diff: base/android/jni_generator/jni_generator.py

Issue 2213963002: Stop relying on using statements in the JNI generator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 f4c6f28319722644e2b79086813e28e47e9aab31..1946d48d39d4e0870a63471cc16a0bddf3c9c64d 100755
--- a/base/android/jni_generator/jni_generator.py
+++ b/base/android/jni_generator/jni_generator.py
@@ -138,7 +138,7 @@ def JavaDataTypeToC(java_type):
def WrapCTypeForDeclaration(c_type):
"""Wrap the C datatype in a JavaRef if required."""
if re.match(RE_SCOPED_JNI_TYPES, c_type):
- return 'const JavaParamRef<' + c_type + '>&'
+ return 'const base::android::JavaParamRef<' + c_type + '>&'
else:
return c_type
@@ -958,7 +958,8 @@ ${NATIVES}
return template.substitute(values)
def GetJavaParamRefForCall(self, c_type, name):
- return Template('JavaParamRef<${TYPE}>(env, ${NAME})').substitute({
+ return Template(
+ 'base::android::JavaParamRef<${TYPE}>(env, ${NAME})').substitute({
'TYPE': c_type,
'NAME': name,
})
@@ -987,7 +988,8 @@ ${NATIVES}
post_call = ''
if re.match(RE_SCOPED_JNI_TYPES, return_type):
post_call = '.Release()'
- return_declaration = 'ScopedJavaLocalRef<' + return_type + '>'
+ return_declaration = ('base::android::ScopedJavaLocalRef<' + return_type +
+ '>')
values = {
'RETURN': return_type,
'RETURN_DECLARATION': return_declaration,
@@ -1071,7 +1073,7 @@ ${RETURN} ${STUB_NAME}(JNIEnv* env, ${PARAMS_IN_STUB}) {
pre_call = ' ' + pre_call
return_declaration = return_type + ' ret ='
if re.match(RE_SCOPED_JNI_TYPES, return_type):
- return_type = 'ScopedJavaLocalRef<' + return_type + '>'
+ return_type = 'base::android::ScopedJavaLocalRef<' + return_type + '>'
return_clause = 'return ' + return_type + '(env, ret);'
else:
return_clause = 'return ret;'
« no previous file with comments | « base/android/jni_generator/golden_sample_for_tests_jni.h ('k') | base/android/jni_generator/testCalledByNatives.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698