OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 is the Android-specific Chromium linker, a tiny shared library | 5 // This is the Android-specific Chromium linker, a tiny shared library |
6 // implementing a custom dynamic linker that can be used to load the | 6 // implementing a custom dynamic linker that can be used to load the |
7 // real Chromium libraries (e.g. libcontentshell.so). | 7 // real Chromium libraries (e.g. libcontentshell.so). |
8 | 8 |
9 // The main point of this linker is to be able to share the RELRO | 9 // The main point of this linker is to be able to share the RELRO |
10 // section of libcontentshell.so (or equivalent) between the browser and | 10 // section of libcontentshell.so (or equivalent) between the browser and |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 } | 725 } |
726 | 726 |
727 // Initialize SDK version info. | 727 // Initialize SDK version info. |
728 LOG_INFO("%s: Retrieving SDK version info", __FUNCTION__); | 728 LOG_INFO("%s: Retrieving SDK version info", __FUNCTION__); |
729 if (!InitSDKVersionInfo(env)) | 729 if (!InitSDKVersionInfo(env)) |
730 return -1; | 730 return -1; |
731 | 731 |
732 // Register native methods. | 732 // Register native methods. |
733 jclass linker_class; | 733 jclass linker_class; |
734 if (!InitClassReference(env, | 734 if (!InitClassReference(env, |
735 "org/chromium/base/library_loader/Linker", | 735 "org/chromium/base/library_loader/LegacyLinker", |
736 &linker_class)) | 736 &linker_class)) |
737 return -1; | 737 return -1; |
738 | 738 |
739 LOG_INFO("%s: Registering native methods", __FUNCTION__); | 739 LOG_INFO("%s: Registering native methods", __FUNCTION__); |
740 env->RegisterNatives(linker_class, | 740 env->RegisterNatives(linker_class, |
741 kNativeMethods, | 741 kNativeMethods, |
742 sizeof(kNativeMethods) / sizeof(kNativeMethods[0])); | 742 sizeof(kNativeMethods) / sizeof(kNativeMethods[0])); |
743 | 743 |
744 // Find LibInfo field ids. | 744 // Find LibInfo field ids. |
745 LOG_INFO("%s: Caching field IDs", __FUNCTION__); | 745 LOG_INFO("%s: Caching field IDs", __FUNCTION__); |
(...skipping 11 matching lines...) Expand all Loading... |
757 crazy_context_t* context = GetCrazyContext(); | 757 crazy_context_t* context = GetCrazyContext(); |
758 crazy_context_set_java_vm(context, vm, JNI_VERSION_1_4); | 758 crazy_context_set_java_vm(context, vm, JNI_VERSION_1_4); |
759 | 759 |
760 // Register the function that the crazy linker can call to post code | 760 // Register the function that the crazy linker can call to post code |
761 // for later execution. | 761 // for later execution. |
762 crazy_context_set_callback_poster(context, &PostForLaterExecution, NULL); | 762 crazy_context_set_callback_poster(context, &PostForLaterExecution, NULL); |
763 | 763 |
764 LOG_INFO("%s: Done", __FUNCTION__); | 764 LOG_INFO("%s: Done", __FUNCTION__); |
765 return JNI_VERSION_1_4; | 765 return JNI_VERSION_1_4; |
766 } | 766 } |
OLD | NEW |