diff options
author | cjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-01 23:12:33 +0000 |
---|---|---|
committer | cjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-01 23:12:33 +0000 |
commit | b50a8b536ce7f2707293966deee3d2816c773392 (patch) | |
tree | 0d794ed9f79d49c8e5f6f7ce1495e2c131663725 /android_webview | |
parent | 043e41762215cd4c6d93880d6c381adcd9e818aa (diff) | |
download | chromium_src-b50a8b536ce7f2707293966deee3d2816c773392.zip chromium_src-b50a8b536ce7f2707293966deee3d2816c773392.tar.gz chromium_src-b50a8b536ce7f2707293966deee3d2816c773392.tar.bz2 |
Make the build control what library(/ies) to load
At build time, we know what native libraries an apk needs to load.
Instead of requiring those .apks to specify this again in code, instead
generate a .java file containing a list of the libraries to load.
This is done using a pattern similar to resources, content_java is built
with a placeholder NativeLibraries.java (i.e. without an actual value
for its libraries list). The corresponding .class file is not included
in content_java.jar. Then, when building an apk we generate the "real"
NativeLibraries.java (with the real String[]) and include that in the
.apk.
This is designed to also support the component build, where, we will
have to calculate the list of libraries at build time, and sort them in
dependency order (because Android's linker, for some reason, doesn't do
that itself).
BUG=158821
TBR=brettw@chromium.org
Review URL: https://chromiumcodereview.appspot.com/12939021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191695 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview')
3 files changed, 18 insertions, 6 deletions
diff --git a/android_webview/Android.mk b/android_webview/Android.mk index 106081a..4b707fb 100644 --- a/android_webview/Android.mk +++ b/android_webview/Android.mk @@ -42,6 +42,11 @@ LOCAL_SRC_FILES += \ $(call all-java-files-under, \ ../components/navigation_interception/android/java/src) \ +# This directory includes .java files that are generated by the normal gyp build, but are checked in +# for the Android build. +# TODO(torne, cjhopman): Consider removing this. +LOCAL_SRC_FILES += \ + $(call all-java-files-under, java/generated_src) # Java files generated from .template rules. This list should match list of java dependencies in # android_webview/all_webview.gyp diff --git a/android_webview/java/generated_src/org/chromium/content/app/NativeLibraries.java b/android_webview/java/generated_src/org/chromium/content/app/NativeLibraries.java new file mode 100644 index 0000000..b569303 --- /dev/null +++ b/android_webview/java/generated_src/org/chromium/content/app/NativeLibraries.java @@ -0,0 +1,13 @@ +// 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. + +package org.chromium.content.app; + +public class NativeLibraries { + // This is the list of native libraries to load. In the normal chromium build, this would be + // automatically generated. + // TODO(torne, cjhopman): Use a generated file for this. + static String[] libraries = { "webviewchromium" }; +} + diff --git a/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java b/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java index 0508c211..7c3ab76 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java +++ b/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java @@ -17,11 +17,6 @@ import org.chromium.content.common.ProcessInitException; * Wrapper for the steps needed to initialize the java and native sides of webview chromium. */ public abstract class AwBrowserProcess { - /** - * The name of the library to load. - */ - private static final String NATIVE_LIBRARY = "webviewchromium"; - private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "webview"; /** @@ -31,7 +26,6 @@ public abstract class AwBrowserProcess { */ public static void loadLibrary() { PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); - LibraryLoader.setLibraryToLoad(NATIVE_LIBRARY); try { LibraryLoader.loadNow(); } catch (ProcessInitException e) { |