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

Side by Side Diff: mojo/runner/android/apk/src/org/chromium/mojo/shell/Bootstrap.java

Issue 1147203002: Revert of Changes caching logic of mojo java apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.mojo.shell; 5 package org.chromium.mojo.shell;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 8
9 import org.chromium.base.JNINamespace; 9 import org.chromium.base.JNINamespace;
10 10
11 import java.io.File; 11 import java.io.File;
12 12
13 /** 13 /**
14 * Runnable used to bootstrap execution of Android Mojo application. For the JNI to work, we need a 14 * Runnable used to bootstrap execution of Android Mojo application. For the JNI to work, we need a
15 * Java class with the application classloader in the call stack. We load this c lass in the 15 * Java class with the application classloader in the call stack. We load this c lass in the
16 * application classloader and call into native from it to achieve that. 16 * application classloader and call into native from it to achieve that.
17 */ 17 */
18 @JNINamespace("mojo::runner") 18 @JNINamespace("mojo::runner")
19 public class Bootstrap implements Runnable { 19 public class Bootstrap implements Runnable {
20 private final Context mContext; 20 private final Context mContext;
21 private final File mBootstrapNativeLibrary; 21 private final File mBootstrapNativeLibrary;
22 private final File mApplicationNativeLibrary; 22 private final File mApplicationNativeLibrary;
23 private final int mHandle; 23 private final int mHandle;
24 private final long mRunApplicationPtr; 24 private final long mRunApplicationPtr;
25 private final boolean mIsCachedApp;
26 25
27 public Bootstrap(Context context, File bootstrapNativeLibrary, File applicat ionNativeLibrary, 26 public Bootstrap(Context context, File bootstrapNativeLibrary, File applicat ionNativeLibrary,
28 Integer handle, Long runApplicationPtr, Boolean isCachedApp) { 27 Integer handle, Long runApplicationPtr) {
29 mContext = context; 28 mContext = context;
30 mBootstrapNativeLibrary = bootstrapNativeLibrary; 29 mBootstrapNativeLibrary = bootstrapNativeLibrary;
31 mApplicationNativeLibrary = applicationNativeLibrary; 30 mApplicationNativeLibrary = applicationNativeLibrary;
32 mHandle = handle; 31 mHandle = handle;
33 mRunApplicationPtr = runApplicationPtr; 32 mRunApplicationPtr = runApplicationPtr;
34 mIsCachedApp = isCachedApp;
35 } 33 }
36 34
37 @Override 35 @Override
38 public void run() { 36 public void run() {
39 System.load(mBootstrapNativeLibrary.getAbsolutePath()); 37 System.load(mBootstrapNativeLibrary.getAbsolutePath());
40 System.load(mApplicationNativeLibrary.getAbsolutePath()); 38 System.load(mApplicationNativeLibrary.getAbsolutePath());
41 nativeBootstrap(mContext, mApplicationNativeLibrary.getAbsolutePath(), m Handle, 39 nativeBootstrap(mContext, mApplicationNativeLibrary.getAbsolutePath(), m Handle,
42 mRunApplicationPtr, mIsCachedApp); 40 mRunApplicationPtr);
43 } 41 }
44 42
45 native void nativeBootstrap(Context context, String libraryPath, int handle, 43 native void nativeBootstrap(Context context, String libraryPath, int handle,
46 long runApplicationPtr, boolean isCachedApp); 44 long runApplicationPtr);
47 } 45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698