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

Issue 1279163006: jni_generator: Wrap all native methods in stubs. (Closed)

Created:
5 years, 4 months ago by Torne
Modified:
5 years, 4 months ago
Reviewers:
rmcilroy
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

jni_generator: Wrap all native methods in stubs. Instead of only wrapping native methods which call C++ methods, wrap them all. This doesn't require any changes to the implementations, but makes the handling of the two kinds of method more consistent in preparation for introducing return type/parameter wrapping in future changes. This also changes the way that some of the stub code is generated to make it less different depending whether native exports are in use, and moves "extern "C"" declarations to be on only the specifically exported symbols instead of applying to all forward declarations. BUG=519562 R=rmcilroy@chromium.org Committed: https://chromium.googlesource.com/chromium/src/+/b37ad14e10041f15a4467022d5169be4dac73ceb

Patch Set 1 #

Total comments: 2

Patch Set 2 : Merge GetForwardDeclaration with GetNativeMethodStubString (no change to output) #

Patch Set 3 : Remove separate forward declaration section entirely #

Unified diffs Side-by-side diffs Delta from patch set Stats (+402 lines, -223 lines) Patch
M base/android/jni_generator/golden_sample_for_tests_jni.h View 1 2 4 chunks +95 lines, -22 lines 0 comments Download
M base/android/jni_generator/jni_generator.py View 1 2 5 chunks +53 lines, -83 lines 0 comments Download
M base/android/jni_generator/testEagerCalledByNativesOption.golden View 2 chunks +6 lines, -2 lines 0 comments Download
M base/android/jni_generator/testInnerClassNatives.golden View 1 2 2 chunks +9 lines, -2 lines 0 comments Download
M base/android/jni_generator/testInnerClassNativesBothInnerAndOuter.golden View 1 2 2 chunks +14 lines, -3 lines 0 comments Download
M base/android/jni_generator/testInnerClassNativesMultiple.golden View 1 2 2 chunks +17 lines, -3 lines 0 comments Download
M base/android/jni_generator/testJNIInitNativeNameOption.golden View 2 chunks +6 lines, -2 lines 0 comments Download
M base/android/jni_generator/testJarJarRemapping.golden View 1 2 2 chunks +32 lines, -5 lines 0 comments Download
M base/android/jni_generator/testMultipleJNIAdditionalImport.golden View 1 2 2 chunks +9 lines, -2 lines 0 comments Download
M base/android/jni_generator/testNativeExportsOption.golden View 1 2 4 chunks +20 lines, -27 lines 0 comments Download
M base/android/jni_generator/testNativeExportsOptionalOption.golden View 1 2 4 chunks +20 lines, -27 lines 0 comments Download
M base/android/jni_generator/testNatives.golden View 1 2 10 chunks +104 lines, -39 lines 0 comments Download
M base/android/jni_generator/testNativesLong.golden View 2 chunks +3 lines, -2 lines 0 comments Download
M base/android/jni_generator/testPureNativeMethodsOption.golden View 2 chunks +6 lines, -2 lines 0 comments Download
M base/android/jni_generator/testSingleJNIAdditionalImport.golden View 1 2 2 chunks +8 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
Torne
Some refactoring before I try out wrapping parameters/return values for all jni methods.. no functional ...
5 years, 4 months ago (2015-08-11 16:58:21 UTC) #2
Torne
On 2015/08/11 16:58:21, Torne wrote: > Some refactoring before I try out wrapping parameters/return values ...
5 years, 4 months ago (2015-08-12 10:18:50 UTC) #3
rmcilroy
Thanks for checking the size implications. 32 bytes seems reasonable :). lgtm https://codereview.chromium.org/1279163006/diff/1/base/android/jni_generator/jni_generator.py File base/android/jni_generator/jni_generator.py ...
5 years, 4 months ago (2015-08-12 10:35:35 UTC) #4
Torne
https://codereview.chromium.org/1279163006/diff/1/base/android/jni_generator/jni_generator.py File base/android/jni_generator/jni_generator.py (right): https://codereview.chromium.org/1279163006/diff/1/base/android/jni_generator/jni_generator.py#newcode1116 base/android/jni_generator/jni_generator.py:1116: stub_visibility = 'static ' On 2015/08/12 10:35:35, rmcilroy wrote: ...
5 years, 4 months ago (2015-08-12 10:37:56 UTC) #5
Torne
OK, I merged the two functions (in a way that doesn't change the generator output ...
5 years, 4 months ago (2015-08-12 16:36:35 UTC) #6
rmcilroy
On 2015/08/12 16:36:35, Torne wrote: > OK, I merged the two functions (in a way ...
5 years, 4 months ago (2015-08-13 10:50:23 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1279163006/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1279163006/40001
5 years, 4 months ago (2015-08-13 10:58:25 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/87803)
5 years, 4 months ago (2015-08-13 11:06:59 UTC) #11
Torne
5 years, 4 months ago (2015-08-14 12:42:50 UTC) #12
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
b37ad14e10041f15a4467022d5169be4dac73ceb (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698