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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 ScopedMainEntryLogger scoped_main_entry_logger; | 94 ScopedMainEntryLogger scoped_main_entry_logger; |
95 main(argc, &argv[0]); | 95 main(argc, &argv[0]); |
96 } | 96 } |
97 } // namespace content | 97 } // namespace content |
98 | 98 |
99 // This is called by the VM when the shared library is first loaded. | 99 // This is called by the VM when the shared library is first loaded. |
100 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { | 100 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { |
101 base::android::InitVM(vm); | 101 base::android::InitVM(vm); |
102 JNIEnv* env = base::android::AttachCurrentThread(); | 102 JNIEnv* env = base::android::AttachCurrentThread(); |
103 | 103 |
104 if (!content::RegisterLibraryLoaderEntryHook(env)) | 104 if (!content::RegisterLibraryLoaderEntryHook(env, true)) |
105 return -1; | 105 return -1; |
106 | 106 |
107 if (!content::android::RegisterShellJni(env)) | 107 if (!content::android::RegisterShellJni(env)) |
108 return -1; | 108 return -1; |
109 | 109 |
110 if (!content::NestedMessagePumpAndroid::RegisterJni(env)) | 110 if (!content::NestedMessagePumpAndroid::RegisterJni(env)) |
111 return -1; | 111 return -1; |
112 | 112 |
113 if (!content::RegisterNativesImpl(env)) | 113 if (!content::RegisterNativesImpl(env)) |
114 return -1; | 114 return -1; |
115 | 115 |
116 content::SetContentMainDelegate(new content::ShellMainDelegate()); | 116 content::SetContentMainDelegate(new content::ShellMainDelegate()); |
117 return JNI_VERSION_1_4; | 117 return JNI_VERSION_1_4; |
118 } | 118 } |
OLD | NEW |