Граф коммитов

19 Коммитов

Автор SHA1 Сообщение Дата
torne 1f6e035226 Remove most android_webview_build conditions from build.
Remove most references to android_webview_build from the build directory
now that we no longer support that build configuration. Fold conditions
into their parents where appropriate. Leave the variable itself defined
to 0 as not all uses in the tree have been removed yet.

A few references are left alone here and will be removed separately in
later changes that will be larger refactorings to eliminate other
variables.

BUG=440793

Review URL: https://codereview.chromium.org/1043913002

Cr-Original-Commit-Position: refs/heads/master@{#323013}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c6fe7a775af41cd98533e89a902b8b67044caa87
2015-03-31 11:51:32 +00:00
torne ff2539c14d Make combined native/manual JNI registration work for clang.
Since clang has trouble with aliases for static functions, go back to
using a trivial wrapper function instead of an alias. Since there is
only one caller of the wrapped, static function, and its address is no
longer taken to generate the manual JNI registration table (the
wrapper's address is already being taken instead), there's no actual
benefit to using an alias anyway, since the compiler will simply inline
the static function into the wrapper.

BUG=442327,460857
TBR=cjhopman@chromium.org

Review URL: https://codereview.chromium.org/953523003

Cr-Original-Commit-Position: refs/heads/master@{#317787}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: cab875835ac9e39183ba0ac4fe30e96d1bdfec45
2015-02-24 12:55:37 +00:00
torne 22ad692dfd Use combined native/manual JNI registration.
Add a new mode to the JNI generator which emits both native JNI exports
and manual registration code, and use this as the default mode (except
when compiling with clang as a clang bug prevents this from working at
present).

Native JNI exports are stripped from binaries by default to enforce that
the correct manual registration code is called (and to save increasing
the dynamic symbol table size), except for binaries that explicitly opt
in to using native exports (i.e. libwebviewchromium). Native exports are
not compatible with the crazy linker, so cannot be used universally.

The WebView-specific call to InitReplacementClassLoader, required by
native export mode, has been moved to base to make it easy for other
binaries to experiment with that mode.

Manual JNI registration can be disabled with a call to
base::android::DisableManualJniRegistration at the beginning of
JNI_OnLoad and this has been added to WebView. We plan to refactor the
Android library entry points to make it possible to avoid needing this
flag by just not calling JNI registration but the work is still ongoing;
the flag gets us the desired WebView startup time improvement in the
meantime.

BUG=442327

Review URL: https://codereview.chromium.org/920883002

Cr-Original-Commit-Position: refs/heads/master@{#317434}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 103bf19477cc121eee7a3c2bdc221f2874c971c3
2015-02-20 23:07:22 +00:00
torne@chromium.org 9647e978dc Refactor lazy JNI registration support.
Rename the "linker_script_copy" target to "android_exports" and move the
link_settings clause to that target. This avoids the linker flag being
duplicated once for every target which includes jni_generator.gypi,
which causes problems on some linker versions.

BUG=402003

Review URL: https://codereview.chromium.org/473173004

git-svn-id: http://src.chromium.org/svn/trunk/src/build@289941 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-08-15 18:19:03 +00:00
mkosiba@chromium.org 4056c70580 Don't register JNI methods for the android_webview.
Rather than registering all jni bindings at startup, only get references
to the class object for those files which require bindings. All others
are satisfied by exporting symbols which can be found automatically by
the VM.

BUG=402003

Review URL: https://codereview.chromium.org/454923002

git-svn-id: http://src.chromium.org/svn/trunk/src/build@288685 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-08-11 11:27:12 +00:00
torne@chromium.org 8787f0ce81 Revert 275652 "Remove unneeded JNI registrations."
This has broken the Android WebView build by introducing an absolute
path into the generated makefiles, rendering them nonportable.

> Remove unneeded JNI registrations.
> 
> Rather than registering all jni bindings at startup, only get references
> to the class object for those files which require bindings. All others
> are satisfied by exporting symbols which can be found automatically by
> dalvik.
> 
> This patch replaces excldue-libs=ALL with ld version script to strip unwanted
> symbols: https://sourceware.org/binutils/docs-2.24/ld/VERSION.html#VERSION
> 
> BUG=
> 
> Review URL: https://codereview.chromium.org/147533004

TBR=sl.ostapenko@samsung.com

Review URL: https://codereview.chromium.org/326603002

git-svn-id: http://src.chromium.org/svn/trunk/src/build@275796 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-06-09 11:33:38 +00:00
sl.ostapenko@samsung.com 7737adfc4c Remove unneeded JNI registrations.
Rather than registering all jni bindings at startup, only get references
to the class object for those files which require bindings. All others
are satisfied by exporting symbols which can be found automatically by
dalvik.

This patch replaces excldue-libs=ALL with ld version script to strip unwanted
symbols: https://sourceware.org/binutils/docs-2.24/ld/VERSION.html#VERSION

BUG=

Review URL: https://codereview.chromium.org/147533004

git-svn-id: http://src.chromium.org/svn/trunk/src/build@275652 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-06-07 08:44:55 +00:00
bulach@chromium.org fb48e3b4d4 Android: changes the JNI generator to use long by default.
BUG=317523

Review URL: https://codereview.chromium.org/131883002

git-svn-id: http://src.chromium.org/svn/trunk/src/build@249461 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-02-06 18:46:45 +00:00
bulach@chromium.org c4dfd98310 Android: sync up latest JNI generator changes from downstream.
Quite a few changes were made downstream, keep them in sync:
- specify the #include files.
- inject the common DCHECKs for class and native pointers.
- inject the check exception call.

BUG=

Review URL: https://codereview.chromium.org/115103002

git-svn-id: http://src.chromium.org/svn/trunk/src/build@243558 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-01-08 14:41:13 +00:00
blundell@chromium.org 9e5b639032 Have jni_generator.gypi specify include_dirs to dependent targets.
Rather than each dependent target of a target that generates jni headers having
to specify the appropriate include_dir manually, jni_generator.gypi can do it
via direct_dependent_settings.

TBR=darin@chromium.org

Review URL: https://codereview.chromium.org/111493006

git-svn-id: http://src.chromium.org/svn/trunk/src/build@241216 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2013-12-17 08:31:34 +00:00
bulach@chromium.org 19630b225e Android: adds ptr_type to jni_generator.
Allows ptr_type to be configurable.

BUG=

Review URL: https://codereview.chromium.org/49913003

git-svn-id: http://src.chromium.org/svn/trunk/src/build@232858 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2013-11-05 00:54:22 +00:00
torne@chromium.org ce220bdd17 Android WebView: add empty jarjar ruleset.
We don't have any jarjar rules yet, but add the empty file now in order
that the downstream build can enable jarjar. This way, when rules are
added later it will just work, instead of breaking the downstream build
temporarily.

Also, make sure that when a jarjar rule file is being used, it's
considered as an input to the JNI generator step, to make sure the JNI
header files get regenerated when the rules change.

BUG=

Review URL: https://chromiumcodereview.appspot.com/15888011

git-svn-id: http://src.chromium.org/svn/trunk/src/build@203141 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2013-05-30 14:16:12 +00:00
torne@chromium.org 048a8b0ebc Android: allow JNI generator to be used with jarjar.
When using jarjar to rename Java packages to avoid name conflicts, the
generated JNI code no longer works as it refers to the old name. Support
using the jarjar remapping list during JNI generation to generate code
that refers to the post-remapping names, since the JNI headers are not
intended to be read by humans anyway.

BUG=

Review URL: https://chromiumcodereview.appspot.com/15715006

git-svn-id: http://src.chromium.org/svn/trunk/src/build@202856 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2013-05-29 13:51:23 +00:00
yfriedman@chromium.org da06ce8ed8 [Android] Change jni_gen_dir to jni_gen_package for jni_generator.
With the old name it was getting relativized which is undesirable. See
bug for more details.

BUG=159133
TBR=ben (nobody really cares about this outside of build/ which cjhopman approved)


Review URL: https://chromiumcodereview.appspot.com/12558005

git-svn-id: http://src.chromium.org/svn/trunk/src/build@186803 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2013-03-07 22:34:05 +00:00
tedchoc@chromium.org 7a45e488db Add gyp flag to specify whether we should optimize JNI generation.
Do not regenerate JNI files (and subsequently the .so file) if they have
not changed.  This will happen if you edit a java file that has a native
counterpart, but the native signatures were not touched.

We do not enable this all the time as some build systems require that
when you modify an input, the output should also be modified.  This
also will result in more command line output, so we'll keep it behind
a developer flag for now.

BUG=


Review URL: https://chromiumcodereview.appspot.com/12314025

git-svn-id: http://src.chromium.org/svn/trunk/src/build@183936 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2013-02-22 00:37:33 +00:00
bulach@chromium.org 7d38bac524 Android: uses "import" section and inner classes for obtaining qualified JNI parameters.
Rather than explicitly listing all the parameters
(see crbug.com/158722), infer almost all of them from the import section and inner classes.
Assumes other classes are in the same package as a fallback.

BUG=159397
TEST=base/android/jni_generator/jni_generator_tests.py


Review URL: https://chromiumcodereview.appspot.com/11363079

git-svn-id: http://src.chromium.org/svn/trunk/src/build@166482 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2012-11-07 19:06:51 +00:00
bulach@chromium.org 97330b958e Android: passes a list of qualified JNI parameters as a param to the generator.
Instead of hardcoding the list of qualified JNI parameters,
pass it as a parameter so that different modules can inject their
classes.
This is the first step in such decoupling; follow up will start splitting
the class_list.jni list closer to their modules.

BUG=158722
TEST=jni_generator_tests

Review URL: https://chromiumcodereview.appspot.com/11339013

git-svn-id: http://src.chromium.org/svn/trunk/src/build@165250 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2012-10-31 22:58:15 +00:00
bulach@chromium.org cd14de0058 Uses gyp "rules" rather than "actions" templates for the JNI generator.
This allow finer grain control over what is rebuilt.
Also, since we have approval over the generated header file name,
it greatly simplifies both the generator and also all the gyp files
as they no longer need to list the header file and keep in sync with the
java file, so the process now is as simple as adding a single java file
to the sources.

BUG=137069
TEST=build on android


Review URL: https://chromiumcodereview.appspot.com/10798010

git-svn-id: http://src.chromium.org/svn/trunk/src/build@147515 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2012-07-19 20:02:55 +00:00
yfriedman@chromium.org 884abb2d56 Add templates for building java and running the jni_generator.
As requested in http://codereview.chromium.org/10073024/, I've created
templates for these two actions. I've also applied them to base.


Review URL: http://codereview.chromium.org/10081035

git-svn-id: http://src.chromium.org/svn/trunk/src/build@132537 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2012-04-17 04:39:52 +00:00