diff options
| author | David Sehr <sehr@google.com> | 2018-01-11 22:55:24 -0800 |
|---|---|---|
| committer | David Sehr <sehr@google.com> | 2018-01-12 12:47:13 -0800 |
| commit | 013fd8073f3ece22b0bba1853d3f3430c8a9e4bd (patch) | |
| tree | d1fb1ce709d4927a8b5f5d7fc673b6932ca4977a /profman | |
| parent | a7e4a15ba7b40fbe1ecd76ce0d99de90aa42201f (diff) | |
| download | art-013fd8073f3ece22b0bba1853d3f3430c8a9e4bd.tar.gz art-013fd8073f3ece22b0bba1853d3f3430c8a9e4bd.tar.bz2 art-013fd8073f3ece22b0bba1853d3f3430c8a9e4bd.zip | |
Create an ART-independent DexFileLoader
Opening DEX files should not rely on instantiating a runtime or having a
large number of dependencies on runtime components. This CL makes
DexFileLoader a stub class that is independent of ART, and introduces a
subclass ArtDexFileLoader that contains the current implementations.
Bug: 22322814
Test: make -j 50 test-art-host
Change-Id: Ia6e92ae93c347057ea0c10455525239cbbe42c03
Diffstat (limited to 'profman')
| -rw-r--r-- | profman/profman.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/profman/profman.cc b/profman/profman.cc index c4216fab99..9f3e3b6ac5 100644 --- a/profman/profman.cc +++ b/profman/profman.cc @@ -39,6 +39,7 @@ #include "base/unix_file/fd_file.h" #include "boot_image_profile.h" #include "bytecode_utils.h" +#include "dex/art_dex_file_loader.h" #include "dex/code_item_accessors-inl.h" #include "dex/dex_file.h" #include "dex/dex_file_loader.h" @@ -329,25 +330,26 @@ class ProfMan FINAL { static constexpr bool kVerifyChecksum = true; for (size_t i = 0; i < dex_locations_.size(); ++i) { std::string error_msg; + const ArtDexFileLoader dex_file_loader; std::vector<std::unique_ptr<const DexFile>> dex_files_for_location; if (use_apk_fd_list) { - if (DexFileLoader::OpenZip(apks_fd_[i], - dex_locations_[i], - /* verify */ true, - kVerifyChecksum, - &error_msg, - &dex_files_for_location)) { + if (dex_file_loader.OpenZip(apks_fd_[i], + dex_locations_[i], + /* verify */ true, + kVerifyChecksum, + &error_msg, + &dex_files_for_location)) { } else { LOG(WARNING) << "OpenZip failed for '" << dex_locations_[i] << "' " << error_msg; continue; } } else { - if (DexFileLoader::Open(apk_files_[i].c_str(), - dex_locations_[i], - /* verify */ true, - kVerifyChecksum, - &error_msg, - &dex_files_for_location)) { + if (dex_file_loader.Open(apk_files_[i].c_str(), + dex_locations_[i], + /* verify */ true, + kVerifyChecksum, + &error_msg, + &dex_files_for_location)) { } else { LOG(WARNING) << "Open failed for '" << dex_locations_[i] << "' " << error_msg; continue; |
