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

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

Issue 1049993002: Get mojo_shell building inside chromium checkout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit Created 5 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 package org.chromium.mojo.shell;
6
7 import android.content.Context;
8
9 import org.chromium.base.JNINamespace;
10
11 import java.io.File;
12
13 /**
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
16 * application classloader and call into native from it to achieve that.
17 */
18 @JNINamespace("mojo::shell")
19 public class Bootstrap implements Runnable {
20 private final Context mContext;
21 private final File mBootstrapNativeLibrary;
22 private final File mApplicationNativeLibrary;
23 private final int mHandle;
24 private final long mRunApplicationPtr;
25
26 public Bootstrap(Context context, File bootstrapNativeLibrary, File applicat ionNativeLibrary,
27 Integer handle, Long runApplicationPtr) {
28 mContext = context;
29 mBootstrapNativeLibrary = bootstrapNativeLibrary;
30 mApplicationNativeLibrary = applicationNativeLibrary;
31 mHandle = handle;
32 mRunApplicationPtr = runApplicationPtr;
33 }
34
35 @Override
36 public void run() {
37 System.load(mBootstrapNativeLibrary.getAbsolutePath());
38 System.load(mApplicationNativeLibrary.getAbsolutePath());
39 nativeBootstrap(mContext, mApplicationNativeLibrary.getAbsolutePath(), m Handle,
40 mRunApplicationPtr);
41 }
42
43 native void nativeBootstrap(Context context, String libraryPath, int handle,
44 long runApplicationPtr);
45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698