OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef BASE_ANDROID_LIBRARY_LOADER_LIBRARY_PREFETCHER_H_ | 5 #ifndef BASE_ANDROID_LIBRARY_LOADER_LIBRARY_PREFETCHER_H_ |
6 #define BASE_ANDROID_LIBRARY_LOADER_LIBRARY_PREFETCHER_H_ | 6 #define BASE_ANDROID_LIBRARY_LOADER_LIBRARY_PREFETCHER_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/debug/proc_maps_linux.h" | 13 #include "base/debug/proc_maps_linux.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 namespace android { | 18 namespace android { |
18 | 19 |
19 // Forks and waits for a process prefetching the native library. This is done in | 20 // Forks and waits for a process prefetching the native library. This is done in |
20 // a forked process for the following reasons: | 21 // a forked process for the following reasons: |
21 // - Isolating the main process from mistakes in the parsing. If the parsing | 22 // - Isolating the main process from mistakes in the parsing. If the parsing |
22 // returns an incorrect address, only the forked process will crash. | 23 // returns an incorrect address, only the forked process will crash. |
23 // - Not inflating the memory used by the main process uselessly, which could | 24 // - Not inflating the memory used by the main process uselessly, which could |
24 // increase its likelihood to be killed. | 25 // increase its likelihood to be killed. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 FRIEND_TEST_ALL_PREFIXES(NativeLibraryPrefetcherTest, | 67 FRIEND_TEST_ALL_PREFIXES(NativeLibraryPrefetcherTest, |
67 TestPercentageOfResidentCodeTwoRegions); | 68 TestPercentageOfResidentCodeTwoRegions); |
68 | 69 |
69 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeLibraryPrefetcher); | 70 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeLibraryPrefetcher); |
70 }; | 71 }; |
71 | 72 |
72 } // namespace android | 73 } // namespace android |
73 } // namespace base | 74 } // namespace base |
74 | 75 |
75 #endif // BASE_ANDROID_LIBRARY_LOADER_LIBRARY_PREFETCHER_H_ | 76 #endif // BASE_ANDROID_LIBRARY_LOADER_LIBRARY_PREFETCHER_H_ |
OLD | NEW |