diff options
author | 2023-02-13 12:42:12 +0000 | |
---|---|---|
committer | 2023-02-21 18:00:00 +0000 | |
commit | 052f5fb6d28717b7ff236c508f5fb36a7705f662 (patch) | |
tree | d148b944857d92cc4ad5666f7139c16b6ba56394 /runtime/common_runtime_test.cc | |
parent | 4184f23701a64e9902ffced803968fcc5601764b (diff) |
Refactor DexFileLoader
The first parameter of the Open methods specifies the data source,
that we intend to load the dex file(s) from. This creates large number
of overloads when multiplied by diversity of the other arguments.
Move the data source parameters to the constructor of DexFileLoader.
Specifically, the constructor just creates the right DexFileContainer,
and the rest of the loader is independent of the data source used.
This removes large amount of the overloads as well as large amount
of copy-pasted code. Majority of ArtDexFileLoader has been removed.
Bug: 266950186
Test: ./art/test.py -b --host --optimizing --64
Change-Id: I6580b49e65441eec93a7e0124be23bd8c859904a
Diffstat (limited to 'runtime/common_runtime_test.cc')
-rw-r--r-- | runtime/common_runtime_test.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc index 131d0d8548..ee574bca62 100644 --- a/runtime/common_runtime_test.cc +++ b/runtime/common_runtime_test.cc @@ -572,10 +572,8 @@ void CommonRuntimeTestImpl::VisitDexes(ArrayRef<const std::string> dexes, for (const std::string& dex : dexes) { std::vector<std::unique_ptr<const DexFile>> dex_files; std::string error_msg; - const ArtDexFileLoader dex_file_loader; - CHECK(dex_file_loader.Open(dex.c_str(), - dex, - /*verify*/ true, + ArtDexFileLoader dex_file_loader(dex); + CHECK(dex_file_loader.Open(/*verify*/ true, /*verify_checksum*/ false, &error_msg, &dex_files)) |