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

Unified Diff: apk/simple_jni.cc

Issue 949803002: Deconstructed APK prototyping Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apk/simple.cc ('k') | base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apk/simple_jni.cc
diff --git a/apk/simple_jni.cc b/apk/simple_jni.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0ca7fda89b3f1a55711db46b6a83cffd19245320
--- /dev/null
+++ b/apk/simple_jni.cc
@@ -0,0 +1,26 @@
+#include "simple.h"
+#include "simple/jni/MainActivity_jni.h"
+#include "base/android/jni_android.h"
+#include "base/android/base_jni_registrar.h"
+#include "base/android/base_jni_onload.h"
+#include "base/android/jni_onload_delegate.h"
+#include "base/memory/scoped_ptr.h"
+
+#include <vector>
+
+
+static jint GetValue(JNIEnv* env, jclass jcaller) {
+ return simple::foo();
+}
+
+// This is called by the VM when the shared library is first loaded.
+JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
+ scoped_ptr<std::vector<base::android::JNIOnLoadDelegate*>> delegates(
+ new std::vector<base::android::JNIOnLoadDelegate*>());
+ if (!base::android::OnJNIOnLoad(vm, delegates.get()))
+ return -1;
+ JNIEnv* env = base::android::AttachCurrentThread();
+ base::android::RegisterJni(env);
+ RegisterNativesImpl(env);
+ return JNI_VERSION_1_4;
+}
« no previous file with comments | « apk/simple.cc ('k') | base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698