Avi Drissman | 4e1b7bc3 | 2022-09-15 14:03:50 | [diff] [blame] | 1 | // Copyright 2012 The Chromium Authors |
[email protected] | a08029b4 | 2012-04-25 03:18:46 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 93c9f9b | 2014-02-10 16:19:22 | [diff] [blame] | 5 | #include "base/android/jni_android.h" |
michaelbai | 842c972d | 2015-01-28 21:40:36 | [diff] [blame] | 6 | #include "content/public/app/content_jni_onload.h" |
[email protected] | 7bd8917 | 2012-06-04 21:48:12 | [diff] [blame] | 7 | #include "content/public/app/content_main.h" |
[email protected] | 993951d | 2013-05-08 21:37:02 | [diff] [blame] | 8 | #include "content/shell/app/shell_main_delegate.h" |
[email protected] | a08029b4 | 2012-04-25 03:18:46 | [diff] [blame] | 9 | |
michaelbai | 842c972d | 2015-01-28 21:40:36 | [diff] [blame] | 10 | // This is called by the VM when the shared library is first loaded. |
11 | JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { | ||||
tobiasjs | b9e287e | 2017-02-08 11:09:50 | [diff] [blame] | 12 | base::android::InitVM(vm); |
Jinsuk Kim | 8d799fe9 | 2018-02-21 05:57:52 | [diff] [blame] | 13 | if (!content::android::OnJNIOnLoadInit()) |
14 | return -1; | ||||
Bo Liu | 1f7dc0c | 2017-07-28 18:58:57 | [diff] [blame] | 15 | content::SetContentMainDelegate(new content::ShellMainDelegate()); |
[email protected] | a08029b4 | 2012-04-25 03:18:46 | [diff] [blame] | 16 | return JNI_VERSION_1_4; |
17 | } |