| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 // This class sets up the environment for running the content browser tests | 5 // This class sets up the environment for running the content browser tests |
| 6 // inside an android application. | 6 // inside an android application. |
| 7 | 7 |
| 8 #include <android/log.h> | 8 #include <android/log.h> |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 } // namespace content | 98 } // namespace content |
| 99 | 99 |
| 100 // This is called by the VM when the shared library is first loaded. | 100 // This is called by the VM when the shared library is first loaded. |
| 101 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { | 101 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { |
| 102 | 102 |
| 103 base::android::SetLibraryLoadedHook(&content::LibraryLoaded); | 103 base::android::SetLibraryLoadedHook(&content::LibraryLoaded); |
| 104 | 104 |
| 105 base::android::InitVM(vm); | 105 base::android::InitVM(vm); |
| 106 JNIEnv* env = base::android::AttachCurrentThread(); | 106 JNIEnv* env = base::android::AttachCurrentThread(); |
| 107 | 107 |
| 108 if (!base::android::RegisterLibraryLoaderEntryHook(env)) | |
| 109 return -1; | |
| 110 | |
| 111 if (!content::android::RegisterShellJni(env)) | 108 if (!content::android::RegisterShellJni(env)) |
| 112 return -1; | 109 return -1; |
| 113 | 110 |
| 114 if (!content::NestedMessagePumpAndroid::RegisterJni(env)) | 111 if (!content::NestedMessagePumpAndroid::RegisterJni(env)) |
| 115 return -1; | 112 return -1; |
| 116 | 113 |
| 117 if (!content::RegisterNativesImpl(env)) | |
| 118 return -1; | |
| 119 | |
| 120 content::SetContentMainDelegate(new content::ShellMainDelegate()); | 114 content::SetContentMainDelegate(new content::ShellMainDelegate()); |
| 121 return JNI_VERSION_1_4; | 115 return JNI_VERSION_1_4; |
| 122 } | 116 } |
| OLD | NEW |