Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: base/android/linker/legacy_linker_jni.cc

Issue 1224963002: Refactor chromium's Linker class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update for review feedback. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698