Prefetch the native library from native code by parsing /proc/pid/maps.

Prefetching the native library by reading its pages speeds up startup on
Android (see the linked bug).

When loading the native library from the APK, there is no file to
associate with the native library. The most reliable way to prefetch the
native library pages is then to look at the pages mapped in the process
address space after the native library has been loaded.

To minimize disruption, the prefetch is done in a separate forked
process. This patch implements the parsing of the address space mappings
and the reading of pages from a forked process. Most of the work is done
before the fork() to avoid potential nasty issues associated with doing
work in a forked process in presence of threads.

BUG=460438

Review URL: https://codereview.chromium.org/1001343002

Cr-Commit-Position: refs/heads/master@{#327473}


CrOS-Libchrome-Original-Commit: 0a830d2548468ecbfb324644b7ecf9ddb46d4b42
diff --git a/base/base.gypi b/base/base.gypi
index bbc3f60..88e7c07 100644
--- a/base/base.gypi
+++ b/base/base.gypi
@@ -62,6 +62,8 @@
           'android/library_loader/library_load_from_apk_status_codes.h',
           'android/library_loader/library_loader_hooks.cc',
           'android/library_loader/library_loader_hooks.h',
+          'android/library_loader/library_prefetcher.cc',
+          'android/library_loader/library_prefetcher.h',
           'android/locale_utils.cc',
           'android/locale_utils.h',
           'android/memory_pressure_listener_android.cc',