Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 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 #include "android_webview/lib/main/webview_main_delegate.h" | |
| 6 #include "base/android/jni_android.h" | |
| 7 #include "content/public/app/android_library_loader_hooks.h" | |
| 8 #include "content/public/app/content_main.h" | |
| 9 | |
| 10 // This is called by the VM when the shared library is first loaded. | |
| 11 // We're loading in a separate java thread to avoid blocking the main UI thread. | |
| 12 // We'll do most of the the initialization later in the main thread. | |
|
joth
2012/08/03 15:20:11
remove the last two lines about threads. We may ev
Torne
2012/08/06 09:48:47
I think we are currently loading the library synch
| |
| 13 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { | |
| 14 base::android::InitVM(vm); | |
| 15 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 16 if (!content::RegisterLibraryLoaderEntryHook(env)) { | |
| 17 return -1; | |
| 18 } | |
| 19 | |
| 20 content::SetContentMainDelegate(new android_webview::WebViewMainDelegate()); | |
| 21 | |
| 22 return JNI_VERSION_1_4; | |
| 23 } | |
| OLD | NEW |