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

Unified Diff: mojo/shell/android/apk/src/org/chromium/mojo_shell_apk/AndroidHandler.java

Issue 772393003: Android handler: inject the application loading part from the shell .so. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Address Ben's comment. Created 6 years 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: mojo/shell/android/apk/src/org/chromium/mojo_shell_apk/AndroidHandler.java
diff --git a/mojo/shell/android/apk/src/org/chromium/mojo_shell_apk/AndroidHandler.java b/mojo/shell/android/apk/src/org/chromium/mojo_shell_apk/AndroidHandler.java
index 698ac7dd651faf0f312ab17c3c735f64233ae70d..e7268ea1d322ac1e6c01a8d27aed9d913ff6636e 100644
--- a/mojo/shell/android/apk/src/org/chromium/mojo_shell_apk/AndroidHandler.java
+++ b/mojo/shell/android/apk/src/org/chromium/mojo_shell_apk/AndroidHandler.java
@@ -65,9 +65,17 @@ public class AndroidHandler {
/**
* Extracts and runs the application libraries contained by the indicated archive.
+ * @param context the application context
+ * @param archivePath the path of the archive containing the application to be run
+ * @param handle handle to the shell to be passed to the native application. On the Java side
+ * this is opaque payload.
+ * @param runApplicationPtr pointer to the function that will set the native thunks and call
+ * into the application MojoMain. On the Java side this is opaque
+ * payload.
*/
@CalledByNative
- private static boolean bootstrap(Context context, String archivePath, int handle) {
+ private static boolean bootstrap(Context context, String archivePath, int handle,
+ long runApplicationPtr) {
File bootstrap_java_library;
File bootstrap_native_library;
try {
@@ -103,9 +111,10 @@ public class AndroidHandler {
Class<?> loadedClass = bootstrapLoader.loadClass(BOOTSTRAP_CLASS);
Class<? extends Runnable> bootstrapClass = loadedClass.asSubclass(Runnable.class);
Constructor<? extends Runnable> constructor = bootstrapClass.getConstructor(
- Context.class, File.class, File.class, Integer.class);
+ Context.class, File.class, File.class, Integer.class, Long.class);
Runnable bootstrapRunnable = constructor.newInstance(context, bootstrap_native_library,
- application_native_library, Integer.valueOf(handle));
+ application_native_library, Integer.valueOf(handle),
+ Long.valueOf(runApplicationPtr));
bootstrapRunnable.run();
} catch (Throwable t) {
Log.e(TAG, "Running Bootstrap failed: " + t);

Powered by Google App Engine
This is Rietveld 408576698