base/android: Choose Linker class exclusively in LibraryLoader
This avoids jumping back and forth between the two classes in order to understand when each linker is used, at what time it can be overridden etc. It is better for readability to make the choice only in one place. Since Linker can totally avoid knowing about LibraryLoader, and not vice versa, putting the choice in LibraryLoader seems better. Consequences for this change that look like a general health improvement: * less static fields; * less packageprivate methods. Fun fact: After this change getLinker() implementation becomes protected by another lock. Currently since the method is called very early, such locking is not needed. There is also no plan to postpone initialization such that lock would be needed. On the other hand, this lock is taken only a handful of times, and makes the class more self-contained. Perhaps the other fields that are initialized early would benefit from a cleaner @GuardedBy look, in a later change. Voting is accepted. Bug: 1154224 Change-Id: I7fa96a23e02a3bc7c28b1c3310e7facf6de0218b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2610028 Commit-Queue: Egor Pasko <pasko@chromium.org> Reviewed-by:Benoit L <lizeb@chromium.org> Cr-Commit-Position: refs/heads/master@{#841062}
Showing
Please register or sign in to comment